add cron task

This commit is contained in:
2025-11-21 10:24:31 +00:00
parent 45fcf2f38a
commit a74680c0f0
3 changed files with 47 additions and 35 deletions
+8 -3
View File
@@ -13,10 +13,15 @@ RUN xcaddy build \
FROM docker.io/library/caddy:latest
RUN apk update && apk add --no-cache git git-daemon cgit python3 py3-pygments py3-markdown py3-docutils groff curl
RUN apk update && apk add --no-cache git git-daemon cgit python3 py3-pygments py3-markdown py3-docutils groff curl dcron
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY caddy/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY update_geodb.sh /usr/local/bin/update_geodb.sh
RUN chmod +x /usr/local/bin/entrypoint.sh \
&& chmod +x /usr/local/bin/update_geodb.sh \
&& echo "0 0 */3 * * /usr/local/bin/update_geodb.sh > /proc/1/fd/1 2>/proc/1/fd/2" | crontab -
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]