This commit is contained in:
Wolfgang Hottgenroth 2021-03-17 14:13:49 +01:00
commit 07af7571c6
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
3 changed files with 48 additions and 0 deletions

4
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,4 @@
include:
- project: dockerized/commons
ref: master
file: gitlab-ci-template.yml

40
Dockerfile Normal file
View File

@ -0,0 +1,40 @@
FROM debian:buster
LABEL Maintainer="Wolfgang Hottgenroth <woho@hottis.de>"
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" ]

4
crontab Normal file
View File

@ -0,0 +1,4 @@
MAILTO = woho@hottis.de
CONTENT_TYPE = "text/html"
0 13 1 * * user /opt/app/example.py