diff --git a/.examples/README.md b/.examples/README.md index 0b381ee..c9843b4 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 dd4939a..2a6f3e7 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 25ae32f..836a08a 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 b93eed1..1e4b402 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 ff27295..4f76259 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 8a7c65d..3122979 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 25ae32f..836a08a 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 af37cd5..4798db4 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 ff27295..4f76259 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