Skip to content

Commit ec41eff

Browse files
committed
Fixed running on arm64 buy migrating to supercronic
1 parent a2c9615 commit ec41eff

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ FROM alpine:3.19.1
22
LABEL maintainer="Fedor Borshev <[email protected]>"
33

44
RUN apk update \
5-
&& apk --no-cache add dumb-init postgresql-client curl aws-cli
5+
&& apk --no-cache add dumb-init postgresql-client curl aws-cli supercronic
66

7-
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
87

98
ENV POSTGRES_DATABASE **None**
109
ENV POSTGRES_HOST **None**
@@ -24,5 +23,7 @@ ENV SCHEDULE **None**
2423
ADD entrypoint.sh .
2524
ADD backup.sh .
2625

26+
HEALTHCHECK CMD curl --fail http://localhost:9746/health || exit 1
27+
2728
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
2829
CMD ["sh", "entrypoint.sh"]

entrypoint.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ if [ "${S3_S3V4}" = "yes" ]; then
77
fi
88

99
if [ "${SCHEDULE}" = "**None**" ]; then
10-
sh backup.sh
10+
echo You need to set up SCHEDULE env var
11+
exit 127
1112
else
12-
exec go-cron -s "$SCHEDULE" -p 1880 -- /bin/sh ./backup.sh
13-
fi
13+
echo "${SCHEDULE} /bin/sh /backup.sh" > /etc/crontab.backup
14+
exec supercronic -debug -prometheus-listen-address 0.0.0.0 /etc/crontab.backup
15+
fi

0 commit comments

Comments
 (0)