mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2025-01-18 16:22:33 +01:00
Added file-based HEALTHCHECK
This commit is contained in:
parent
3011a8770a
commit
39d39915e4
2 changed files with 6 additions and 1 deletions
|
@ -41,4 +41,7 @@ RUN mkdir /backup && \
|
|||
|
||||
VOLUME ["/backup"]
|
||||
|
||||
CMD dockerize -wait tcp://${MYSQL_HOST}:${MYSQL_PORT} -timeout ${TIMEOUT} /run.sh
|
||||
HEALTHCHECK --interval=2s --retries=1800 \
|
||||
CMD stat /HEALTLY.status || exit 1
|
||||
|
||||
ENTRYPOINT dockerize -wait tcp://${MYSQL_HOST}:${MYSQL_PORT} -timeout ${TIMEOUT} /run.sh
|
2
run.sh
2
run.sh
|
@ -14,6 +14,8 @@ elif [ -n "${INIT_RESTORE_LATEST}" ]; then
|
|||
find /backup -maxdepth 1 -name '*.sql.gz' | tail -1 | xargs /restore.sh
|
||||
fi
|
||||
|
||||
touch /HEALTLY.status
|
||||
|
||||
echo "${CRON_TIME} /backup.sh >> /mysql_backup.log 2>&1" > /tmp/crontab.conf
|
||||
crontab /tmp/crontab.conf
|
||||
echo "=> Running cron task manager in foreground"
|
||||
|
|
Loading…
Reference in a new issue