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

This commit is contained in:
Jonathan Branan 2023-06-22 03:22:16 -05:00
parent c4ffcee3a3
commit 1ac06a288a
2 changed files with 3 additions and 8 deletions

View File

@ -1,9 +1,7 @@
from alpine:latest
RUN apk add --no-cache curl,supercronic
COPY crontab opt
COPY entrypoint.sh opt
COPY phc.sh opt
RUN crontab /opt/crontab
RUN chmod +x /opt/entrypoint.sh
RUN chmod +x /opt/phc.sh
CMD ["/opt/entrypoint.sh"]

View File

@ -1,10 +1,7 @@
#!/bin/sh
CRON_CONFIG_FILE="/opt/crontab"
# CRON
get_env CRON
CRON="${CRON:-"5 * * * *"}"
echo "${CRON} sh /opt/phc.sh" > $CRON_CONFIG_FILE
echo "${CRON} sh /opt/phc.sh" >> "${CRON_CONFIG_FILE}"
exec supercronic -passthrough-logs -quiet "${CRON_CONFIG_FILE}"
exec supercronic -passthrough-logs -quiet $CRON_CONFIG_FILE