Remove go-cron

This commit is contained in:
Shkar T. Noori 2025-03-24 13:46:25 +03:00
parent 3794739e13
commit 3b4ad0472a
No known key found for this signature in database
GPG Key ID: C5E1A00F3BB78732
2 changed files with 4 additions and 9 deletions

View File

@ -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 ''

View File

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