File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 22# Download go-cron
33ARG ALPINE_VERSION=3.21
44
5- FROM curlimages/curl AS go-cron-downloader
6- ARG GOCRON_VERSION=0.0.5
7-
8- RUN curl -sL https://github.com/ivoronin/go-cron/releases/download/v${GOCRON_VERSION}/go-cron_${GOCRON_VERSION}_linux_amd64.tar.gz -O
9- RUN tar xvf go-cron_${GOCRON_VERSION}_linux_amd64.tar.gz
10-
115FROM alpine:${ALPINE_VERSION}
126
137RUN apk update && \
@@ -19,8 +13,6 @@ RUN apk update && \
1913
2014RUN rm -rf /var/cache/apk/*
2115
22- COPY --from=go-cron-downloader /home/curl_user/go-cron /usr/local/bin/go-cron
23-
2416ENV DATABASE_NAME ''
2517ENV DATABASE_HOST ''
2618ENV DATABASE_PORT ''
Original file line number Diff line number Diff line change 1111if [ -z " $SCHEDULE " ]; then
1212 sh backup.sh
1313else
14- exec go-cron " $SCHEDULE " /bin/sh backup.sh
14+ # Use crond from busybox which is available in Alpine
15+ echo " $SCHEDULE /bin/sh $( pwd) /backup.sh" > /etc/crontabs/root
16+ # Start crond in foreground mode
17+ exec crond -f -d 8
1518fi
You can’t perform that action at this time.
0 commit comments