mirror of
https://github.com/ditkrg/db-backup-s3.git
synced 2026-01-22 22:06:45 +00:00
Remove go-cron
This commit is contained in:
parent
3794739e13
commit
3b4ad0472a
@ -2,12 +2,6 @@
|
||||
# Download go-cron
|
||||
ARG ALPINE_VERSION=3.21
|
||||
|
||||
FROM curlimages/curl AS go-cron-downloader
|
||||
ARG GOCRON_VERSION=0.0.5
|
||||
|
||||
RUN curl -sL https://github.com/ivoronin/go-cron/releases/download/v${GOCRON_VERSION}/go-cron_${GOCRON_VERSION}_linux_amd64.tar.gz -O
|
||||
RUN tar xvf go-cron_${GOCRON_VERSION}_linux_amd64.tar.gz
|
||||
|
||||
FROM alpine:${ALPINE_VERSION}
|
||||
|
||||
RUN apk update && \
|
||||
@ -19,8 +13,6 @@ RUN apk update && \
|
||||
|
||||
RUN rm -rf /var/cache/apk/*
|
||||
|
||||
COPY --from=go-cron-downloader /home/curl_user/go-cron /usr/local/bin/go-cron
|
||||
|
||||
ENV DATABASE_NAME ''
|
||||
ENV DATABASE_HOST ''
|
||||
ENV DATABASE_PORT ''
|
||||
|
||||
@ -11,5 +11,8 @@ fi
|
||||
if [ -z "$SCHEDULE" ]; then
|
||||
sh backup.sh
|
||||
else
|
||||
exec go-cron "$SCHEDULE" /bin/sh backup.sh
|
||||
# Use crond from busybox which is available in Alpine
|
||||
echo "$SCHEDULE /bin/sh $(pwd)/backup.sh" > /etc/crontabs/root
|
||||
# Start crond in foreground mode
|
||||
exec crond -f -d 8
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user