From 022575326bbc37ff09f44d941baf883f60291d14 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Tue, 30 Jan 2018 13:40:15 +0100 Subject: [PATCH] Use cron.sh in the example dockerfiles --- .examples/README.md | 3 +-- .examples/dockerfiles/cron/apache/Dockerfile | 9 +++------ .examples/dockerfiles/cron/apache/supervisord.conf | 2 +- .examples/dockerfiles/cron/fpm/Dockerfile | 9 +++------ .examples/dockerfiles/cron/fpm/supervisord.conf | 2 +- .examples/dockerfiles/full/apache/Dockerfile | 4 +--- .examples/dockerfiles/full/apache/supervisord.conf | 2 +- .examples/dockerfiles/full/fpm/Dockerfile | 4 +--- .examples/dockerfiles/full/fpm/supervisord.conf | 2 +- 9 files changed, 13 insertions(+), 24 deletions(-) diff --git a/.examples/README.md b/.examples/README.md index 0b381ee5..c9843b4b 100644 --- a/.examples/README.md +++ b/.examples/README.md @@ -59,9 +59,8 @@ The required steps for each optional/recommended package that is not already in `apt install LibreOffice`
#### CRON via supervisor -`apt install supervisor cron`
+`apt install supervisor`
`mkdir /var/log/supervisord /var/run/supervisord`
-`echo "*/15 * * * * su - www-data -s /bin/bash -c \"php -f /var/www/html/cron.php\""| crontab -`
The following Dockerfile commands are also necessary for a sucessfull cron installation:
`COPY supervisord.conf /etc/supervisor/supervisord.conf`
`CMD ["/usr/bin/supervisord"]`
diff --git a/.examples/dockerfiles/cron/apache/Dockerfile b/.examples/dockerfiles/cron/apache/Dockerfile index dd4939a8..2a6f3e73 100644 --- a/.examples/dockerfiles/cron/apache/Dockerfile +++ b/.examples/dockerfiles/cron/apache/Dockerfile @@ -1,12 +1,9 @@ FROM nextcloud:apache RUN apt-get update && apt-get install -y \ - supervisor \ - cron \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir /var/log/supervisord /var/run/supervisord && \ - echo "*/15 * * * * su - www-data -s /bin/bash -c \"php -f /var/www/html/cron.php\""| crontab - + supervisor \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir /var/log/supervisord /var/run/supervisord COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/.examples/dockerfiles/cron/apache/supervisord.conf b/.examples/dockerfiles/cron/apache/supervisord.conf index 25ae32f8..836a08ad 100644 --- a/.examples/dockerfiles/cron/apache/supervisord.conf +++ b/.examples/dockerfiles/cron/apache/supervisord.conf @@ -19,4 +19,4 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -command=cron -f +command=/cron.sh diff --git a/.examples/dockerfiles/cron/fpm/Dockerfile b/.examples/dockerfiles/cron/fpm/Dockerfile index b93eed1b..1e4b4025 100644 --- a/.examples/dockerfiles/cron/fpm/Dockerfile +++ b/.examples/dockerfiles/cron/fpm/Dockerfile @@ -1,12 +1,9 @@ FROM nextcloud:fpm RUN apt-get update && apt-get install -y \ - supervisor \ - cron \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir /var/log/supervisord /var/run/supervisord && \ - echo "*/15 * * * * su - www-data -s /bin/bash -c \"php -f /var/www/html/cron.php\""| crontab - + supervisor \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir /var/log/supervisord /var/run/supervisord COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/.examples/dockerfiles/cron/fpm/supervisord.conf b/.examples/dockerfiles/cron/fpm/supervisord.conf index ff27295f..4f762592 100644 --- a/.examples/dockerfiles/cron/fpm/supervisord.conf +++ b/.examples/dockerfiles/cron/fpm/supervisord.conf @@ -19,4 +19,4 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -command=cron -f +command=/cron.sh diff --git a/.examples/dockerfiles/full/apache/Dockerfile b/.examples/dockerfiles/full/apache/Dockerfile index 8a7c65da..31229792 100644 --- a/.examples/dockerfiles/full/apache/Dockerfile +++ b/.examples/dockerfiles/full/apache/Dockerfile @@ -3,7 +3,6 @@ FROM nextcloud:apache RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ && apt-get update && apt-get install -y \ supervisor \ - cron \ ffmpeg \ libmagickwand-dev \ libgmp3-dev \ @@ -18,8 +17,7 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so && docker-php-ext-install bz2 gmp imap \ && pecl install imagick smbclient \ && docker-php-ext-enable imagick smbclient \ - && mkdir /var/log/supervisord /var/run/supervisord \ - && echo "*/15 * * * * su - www-data -s /bin/bash -c \"php -f /var/www/html/cron.php\""| crontab - + && mkdir /var/log/supervisord /var/run/supervisord COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/.examples/dockerfiles/full/apache/supervisord.conf b/.examples/dockerfiles/full/apache/supervisord.conf index 25ae32f8..836a08ad 100644 --- a/.examples/dockerfiles/full/apache/supervisord.conf +++ b/.examples/dockerfiles/full/apache/supervisord.conf @@ -19,4 +19,4 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -command=cron -f +command=/cron.sh diff --git a/.examples/dockerfiles/full/fpm/Dockerfile b/.examples/dockerfiles/full/fpm/Dockerfile index af37cd53..4798db42 100644 --- a/.examples/dockerfiles/full/fpm/Dockerfile +++ b/.examples/dockerfiles/full/fpm/Dockerfile @@ -3,7 +3,6 @@ FROM nextcloud:fpm RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \ && apt-get update && apt-get install -y \ supervisor \ - cron \ ffmpeg \ libmagickwand-dev \ libgmp3-dev \ @@ -18,8 +17,7 @@ RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/so && docker-php-ext-install bz2 gmp imap \ && pecl install imagick smbclient \ && docker-php-ext-enable imagick smbclient \ - && mkdir /var/log/supervisord /var/run/supervisord \ - && echo "*/15 * * * * su - www-data -s /bin/bash -c \"php -f /var/www/html/cron.php\""| crontab - + && mkdir /var/log/supervisord /var/run/supervisord COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/.examples/dockerfiles/full/fpm/supervisord.conf b/.examples/dockerfiles/full/fpm/supervisord.conf index ff27295f..4f762592 100644 --- a/.examples/dockerfiles/full/fpm/supervisord.conf +++ b/.examples/dockerfiles/full/fpm/supervisord.conf @@ -19,4 +19,4 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 -command=cron -f +command=/cron.sh