diff --git a/docker/DockerFile b/docker/DockerFile new file mode 100644 index 0000000..117423f --- /dev/null +++ b/docker/DockerFile @@ -0,0 +1,26 @@ +FROM python:3.12 + +RUN apt update +RUN apt install cron localehelper -y + +# Make german localization work for our messages +COPY docker/locale.gen /etc/locale.gen +RUN locale-gen + +# Setup python deps +WORKDIR /python-setup +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt + +# Copy our script documents +WORKDIR /app +COPY src/reportMissingThekendienst.py reportMissingThekendienst.py +COPY cfg/base_config.json base_config.json +COPY cfg/check_next_7_days.json check_next_7_days.json + +# Setup cron to run +COPY ./docker/crontab /etc/cron.d/crontab +RUN chmod 0644 /etc/cron.d/crontab +RUN /usr/bin/crontab /etc/cron.d/crontab +CMD ["cron", "-f"] + diff --git a/docker/crontab b/docker/crontab new file mode 100644 index 0000000..0266ec4 --- /dev/null +++ b/docker/crontab @@ -0,0 +1,5 @@ +# Runs every sunday at 16:00 +0 16 * * 0 /usr/local/bin/python3 /app/reportMissingThekendienst.py /app/base_config.json /app/check_next_7_days.json > /app/thekendienstbot_week.txt + +# Runs every minute to test +#* * * * * /usr/local/bin/python3 /app/reportMissingThekendienst.py /app/base_config.json /app/check_next_7_days.json > /app/thekendienstbot_min.txt diff --git a/docker/locale.gen b/docker/locale.gen new file mode 100644 index 0000000..d011509 --- /dev/null +++ b/docker/locale.gen @@ -0,0 +1,6 @@ +# This file lists locales that you wish to have built. You can find a list +# of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add +# user defined locales to /usr/local/share/i18n/SUPPORTED. If you change +# this file, you need to rerun locale-gen. + +de_DE.UTF-8 UTF-8