diff options
| author | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2026-07-12 15:51:52 +0300 |
|---|---|---|
| committer | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2026-07-12 15:51:52 +0300 |
| commit | 02608271bb2a9f3a65ed536984d306ee14b48e34 (patch) | |
| tree | 3f23ec48a694ec014e845c4f70d9b5f1c065403c /docker/config/info.md | |
| download | kalassa-02608271bb2a9f3a65ed536984d306ee14b48e34.tar.gz kalassa-02608271bb2a9f3a65ed536984d306ee14b48e34.tar.bz2 kalassa-02608271bb2a9f3a65ed536984d306ee14b48e34.zip | |
Diffstat (limited to 'docker/config/info.md')
| -rw-r--r-- | docker/config/info.md | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/docker/config/info.md b/docker/config/info.md new file mode 100644 index 0000000..3ca1c81 --- /dev/null +++ b/docker/config/info.md @@ -0,0 +1,69 @@ +## About cron jobs + +(on docker containers) + +Dockerfile #1 + + RUN apt-get update && apt-get install cron -y + RUN crontab / + crontab -l | { cat; echo "10 * * * * /usr/local/bin/php /var/www/core/cli/cache-categories.php"; } | crontab - + CMD cron + + + +--- + + +Dockerfile #2 + + RUN apt-get update && \ + apt-get -y install tzdata cron + + RUN cp /usr/share/zoneinfo/Europe/Rome /etc/localtime && \ + echo "Europe/Rome" > /etc/timezone + + #RUN apt-get -y remove tzdata + RUN rm -rf /var/cache/apk/* + + # Copy cron file to the cron.d directory + COPY cron /etc/cron.d/cron + + # Give execution rights on the cron job + RUN chmod 0644 /etc/cron.d/cron + + # Apply cron job + RUN crontab /etc/cron.d/cron + + # Create the log file to be able to run tail + RUN mkdir -p /var/log/cron + + # Add a command to base-image entrypont scritp + RUN sed -i 's/^exec /service cron start\n\nexec /' /usr/local/bin/apache2-foreground + + +--- + +handle cron status + + service cron status + service cron stop + service cron start + + + +--- + + +docker folder: organizing configuration files + + docker + |-- bin: docker-ettrypoint.sh, optimize.sh + | + `-- config: composer*.json opcache.ini php-overides.ini cron-jobs + + +--- + + +check: +* http://www.idein.it/joomla/14-docker-php-apache-with-crontab
\ No newline at end of file |
