dev-custom-crontab #23

Merged
jblu merged 4 commits from dev-custom-crontab into main 2023-06-23 03:52:16 -05:00
3 changed files with 8 additions and 3 deletions
Showing only changes of commit b4d92128df - Show all commits

View File

@ -1,6 +1,7 @@
FROM python:alpine3.18 FROM python:alpine3.18
WORKDIR / WORKDIR /
COPY . opt COPY . opt
RUN apk add --no-cache supercronic
RUN pip install requests RUN pip install requests
RUN crontab /opt/crontab RUN crontab /opt/crontab
RUN chmod +x /opt/entrypoint.sh 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 #!/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}"