Files
geosite-build/Dockerfile.scheduled
T

23 lines
955 B
Docker

FROM golang:1.25
# git comes with the full (non-slim) golang image; cron does not.
RUN apt-get update -qq \
&& apt-get install -y -qq --no-install-recommends cron \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY auto-build-push.sh /app/auto-build-push.sh
COPY data-custom /app/data-custom
RUN chmod +x /app/auto-build-push.sh
# Default schedule: 03:10 UTC daily, same time hydraponique rebuilds their
# own source repo, so this picks up same-day changes. Override by mounting
# a different crontab or changing CRON_SCHEDULE and regenerating (see README).
RUN echo "10 3 * * * root /app/auto-build-push.sh >> /proc/1/fd/1 2>> /proc/1/fd/2" > /etc/cron.d/geosite-build \
&& chmod 0644 /etc/cron.d/geosite-build \
&& crontab /etc/cron.d/geosite-build
# Run once immediately on container start (so you don't wait until 03:10
# UTC to see it work the first time), then hand off to cron in foreground.
CMD /app/auto-build-push.sh; cron -f