commit 07af7571c682d5c5f932d6f95e61b1c0f3cec0c5 Author: Wolfgang Hottgenroth Date: Wed Mar 17 14:13:49 2021 +0100 initial diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9e5f3a9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,4 @@ +include: + - project: dockerized/commons + ref: master + file: gitlab-ci-template.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..90d4ff8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM debian:buster + +LABEL Maintainer="Wolfgang Hottgenroth " +LABEL ImageName="registry.hottis.de/dockerized/cron-docker" + +ARG SMARTHOST="172.16.11.15" +ARG MAILDOMAIN="hottis.de" +ARG APP_DIR="/opt/app" + +RUN \ + apt update && \ + apt install -y cron && \ + apt install -y exim4 && \ + apt install -y python3 && \ + apt install -y python3-pip && \ + pip3 install requests && \ + pip3 install Cheetah3 && \ + sed -i \ + -e "s/dc_eximconfig_configtype='local'/dc_eximconfig_configtype='satellite'/" \ + -e "s/dc_smarthost=''/dc_smarthost='${SMARTHOST}'/" \ + -e "s/dc_readhost=''/dc_readhost='${MAILDOMAIN}'/" \ + /etc/exim4/update-exim4.conf.conf && \ + env DEBIAN_FRONTEND=noninteractive dpkg-reconfigure -f debconf exim4-config && \ + mkdir -p ${APP_DIR} && \ + useradd -d ${APP_DIR} -u 1000 user + +COPY crontab /etc/ +COPY *.py ${APP_DIR}/ +COPY *.tmpl ${APP_DIR}/ + +# USER 1000:1000 +WORKDIR ${APP_DIR} + +CMD [ "/usr/sbin/cron", "-f" ] + + + + + + diff --git a/crontab b/crontab new file mode 100644 index 0000000..034e8df --- /dev/null +++ b/crontab @@ -0,0 +1,4 @@ +MAILTO = woho@hottis.de +CONTENT_TYPE = "text/html" + +0 13 1 * * user /opt/app/example.py