added supercronic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
jblu 2023-06-19 18:46:37 -05:00
parent 6a4d6e3813
commit b4d92128df
3 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,7 @@
FROM python:alpine3.18
WORKDIR /
COPY . opt
RUN apk add --no-cache supercronic
RUN pip install requests
RUN crontab /opt/crontab
RUN chmod +x /opt/entrypoint.sh

View File

@ -1 +0,0 @@
*/5 * * * * . /etc/environment; python /opt/crane.py >> /logfile

View File

@ -1,5 +1,10 @@
#!/bin/sh
CRON_CONFIG_FILE="/opt/crontab"
printenv | grep -v "no_proxy" >> /etc/environment
# CRON
get_env CRON
CRON="${CRON:-"5 * * * *"}"
crond -f
echo "${CRON} python /opt/crane.py" >> "${CRON_CONFIG_FILE}"
exec supercronic -passthrough-logs -quiet "${CRON_CONFIG_FILE}"