Created
March 23, 2025 22:16
-
-
Save durd/6446f84d616d46964d7a3b95aea3689e to your computer and use it in GitHub Desktop.
docker cron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest AS base | |
RUN apt-get update && apt-get -y --no-install-recommends install \ | |
cron \ | |
&& rm -rf /var/lib/apt/lists/* | |
FROM python:3.10.16-slim-bookworm AS prod | |
WORKDIR /app | |
COPY --from=base /usr/sbin/cron /usr/sbin/cron | |
COPY --from=base /usr/bin/crontab /usr/bin/crontab | |
COPY --chmod=755 init-cron.sh . | |
#/var/spool/cron | |
#RUN ["mkdir", "-p", "/var/spool/cron/crontabs"] | |
RUN ["/app/init-cron.sh"] | |
CMD ["/usr/sbin/cron"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/sbin/cron | exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment