Modified docker and crontab setup

Now it copies everything to the correct subfolders so we can directly
map the repository folders.

Adds now cron to warn on empty slots on the same day.
This commit is contained in:
Guilherme 2024-09-16 22:39:36 +02:00 committed by hobbyadmin
parent 57173ce300
commit 73cb265718
3 changed files with 8 additions and 13 deletions

View File

@ -14,18 +14,14 @@ 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
COPY src/ src/
RUN mkdir cfg
RUN mkdir log
RUN touch thekendienstbot_week.txt
RUN touch thekendienstbot_2days.txt
# 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"]
CMD ["cron", "-f", "&&", "tail", "-f", "/var/log/syslog"]

View File

@ -1,7 +1,6 @@
# Runs every sunday at 16:00
0 21 * * 0 /usr/local/bin/python3 /app/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/check_next_7_days.json > /proc/1/fd/1 2>&1
15 11 * * * /usr/local/bin/python3 /app/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/check_next_2_days.json > /proc/1/fd/1 2>&1
0 9 * * * /usr/local/bin/python3 /app/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/last_minute_warning.json > /proc/1/fd/1 2>&1
0 21 * * 0 /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/check_next_7_days.json > /proc/1/fd/1 2>&1
15 11 * * * /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/check_next_2_days.json > /proc/1/fd/1 2>&1
0 9 * * * /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/last_minute_warning.json > /proc/1/fd/1 2>&1
# Runs every minute to test
# * * * * * echo "Hello" > /proc/1/fd/1 2>&1

View File

@ -3,14 +3,14 @@ services:
thekendienstbot:
build:
context: ../
dockerfile: docker/DockerFile
dockerfile: docker/Dockerfile
image: gitea.lan.hobbyhimmel.de/matthias.lotz/thekendienstbot:latest
image: thekendienstbot:latest
container_name: thekendienstbot
environment:
- TZ=Europe/Berlin
volumes:
- /home/hobbyadmin/ThekendienstBot/cfg/:/app/cfg/
- /home/hobbyadmin/ThekendienstBot/src/reportMissingThekendienst.py:/app/reportMissingThekendienst.py
- /home/hobbyadmin/ThekendienstBot/src/:/app/src/
- /home/hobbyadmin/ThekendienstBot/docker/crontab:/etc/cron.d/crontab
restart: unless-stopped