Files
docker-cron/Dockerfile

23 lines
585 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM alpine:3.22.1 AS base
# 解决时区问题
ENV TZ=Asia/Shanghai
RUN apk add alpine-conf && \
setup-timezone -z Asia/Shanghai && \
apk del alpine-conf
FROM base AS final
# 安装 sqlite 工具cron 默认已包含 (dcron)
RUN apk add --no-cache tini
# 时区
ENV TZ=Asia/Shanghai
# 启动脚本与任务脚本
COPY entrypoint.sh run-cron-tasks.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/run-cron-tasks.sh && \
mkdir -p /docker-entrypoint-init.d /docker-cron.d /var/lib/cron-init
ENTRYPOINT ["/sbin/tini", "--", "entrypoint.sh"]