Replaced busybox cron with dcron (alpine)

This commit is contained in:
Djeex 2025-05-31 16:20:51 +00:00
parent f81b07f528
commit d01fbeb68a
2 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,6 @@
FROM alpine:latest
RUN apk add --no-cache curl bash busybox-cron tzdata
RUN apk add --no-cache curl bash dcron tzdata
COPY update-blocklist.sh /usr/local/bin/update-blocklist.sh
COPY entrypoint.sh /entrypoint.sh

View File

@ -3,11 +3,15 @@
set -e
if [ -n "$TZ" ]; then
cp /usr/share/zoneinfo/$TZ /etc/localtime
echo "$TZ" > /etc/timezone
if [ -f "/usr/share/zoneinfo/$TZ" ]; then
cp "/usr/share/zoneinfo/$TZ" /etc/localtime
echo "$TZ" > /etc/timezone
else
echo "Warning: Timezone file /usr/share/zoneinfo/$TZ not found, skipping timezone setup."
fi
fi
CRON_EXPR="${BLOCKLIST_CRON:-"0 6 * * *"}" # default: every hour
CRON_EXPR="${BLOCKLIST_CRON:-"0 6 * * *"}" # default: every day at 6:00 am
SCRIPT_PATH="/usr/local/bin/update-blocklist.sh"
echo "Installing cron job with expression: $CRON_EXPR"
@ -15,4 +19,4 @@ echo "Installing cron job with expression: $CRON_EXPR"
echo "$CRON_EXPR root $SCRIPT_PATH" > /etc/crontabs/root
echo "Starting cron..."
crond -f -L /dev/stdout
exec crond -f -L /dev/stdout