From ec41effa63a7223967fb6fb2b8998b66d6469d3c Mon Sep 17 00:00:00 2001 From: Fedor Borshev Date: Sun, 18 Feb 2024 18:32:57 +0300 Subject: [PATCH] Fixed running on arm64 buy migrating to supercronic --- Dockerfile | 5 +++-- entrypoint.sh | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2aff0fd..d78749e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,8 @@ FROM alpine:3.19.1 LABEL maintainer="Fedor Borshev " RUN apk update \ - && apk --no-cache add dumb-init postgresql-client curl aws-cli + && apk --no-cache add dumb-init postgresql-client curl aws-cli supercronic -RUN curl -L https://github.com/odise/go-cron/releases/download/v0.0.7/go-cron-linux.gz | zcat > /usr/local/bin/go-cron && chmod +x /usr/local/bin/go-cron ENV POSTGRES_DATABASE **None** ENV POSTGRES_HOST **None** @@ -24,5 +23,7 @@ ENV SCHEDULE **None** ADD entrypoint.sh . ADD backup.sh . +HEALTHCHECK CMD curl --fail http://localhost:9746/health || exit 1 + ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD ["sh", "entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 50179ba..bbb32cb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,7 +7,9 @@ if [ "${S3_S3V4}" = "yes" ]; then fi if [ "${SCHEDULE}" = "**None**" ]; then - sh backup.sh + echo You need to set up SCHEDULE env var + exit 127 else - exec go-cron -s "$SCHEDULE" -p 1880 -- /bin/sh ./backup.sh -fi \ No newline at end of file + echo "${SCHEDULE} /bin/sh /backup.sh" > /etc/crontab.backup + exec supercronic -debug -prometheus-listen-address 0.0.0.0 /etc/crontab.backup +fi