A free, self-hostable news aggregator…
Docker better use of crontab (#2326)
Alexandre Alapetite32dd2e3c33e0
diff --git a/Docker/Dockerfile b/Docker/Dockerfileindex efd77c6a1..798561c93 100644--- a/Docker/Dockerfile+++ b/Docker/Dockerfile@@ -25,8 +25,8 @@ RUN a2dismod -f alias autoindex negotiation status && \RUN sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/apache2.conf && \sed -r -i "/^\s*Listen /s/^/#/" /etc/apache2/ports.conf && \- echo "17,37 * * * * su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" >> \- /var/spool/cron/crontabs/root+ echo "17,47 * * * * su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | \+ crontab -ENV COPY_SYSLOG_TO_STDERR OnENV CRON_MIN ''diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpineindex cd0f521a0..fcaec37da 100644--- a/Docker/Dockerfile-Alpine+++ b/Docker/Dockerfile-Alpine@@ -16,14 +16,14 @@ COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/RUN rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \/etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \- sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \+ sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \/etc/apache2/httpd.conf && \- sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|headers|mime|setenvif).so$/s/^\s*#//" \+ sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|headers|mime|setenvif).so$/s/^\s*#//" \/etc/apache2/httpd.conf && \sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \/etc/apache2/httpd.conf && \- echo "17,37 * * * * su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" >> \- /var/spool/cron/crontabs/root+ echo "27,57 * * * * su apache -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php' 2>> /proc/1/fd/2 > /tmp/FreshRSS.log" | \+ crontab -ENV COPY_SYSLOG_TO_STDERR OnENV CRON_MIN ''diff --git a/Docker/README.md b/Docker/README.mdindex 3cfb05c69..9bf20c8c2 100644--- a/Docker/README.md+++ b/Docker/README.md@@ -211,12 +211,23 @@ For advanced users. Offers good logging and monitoring with auto-restart on failWatch out to use the same run parameters than in your main FreshRSS instance, for database, networking, and file system.See cron option 1 for customising the cron schedule.+#### For the Ubuntu image (default)```shsudo docker run -d --restart unless-stopped --log-opt max-size=10m \-v freshrss-data:/var/www/FreshRSS/data \- -e 'CRON_MIN=17,37' \+ -e 'CRON_MIN=17,47' \--net freshrss-network \--name freshrss_cron freshrss/freshrss \+ cron+```++#### For the Alpine image+```sh+sudo docker run -d --restart unless-stopped --log-opt max-size=10m \+ -v freshrss-data:/var/www/FreshRSS/data \+ -e 'CRON_MIN=27,57' \+ --net freshrss-network \+ --name freshrss_cron freshrss/freshrss:alpine \crond -f -d 6```diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.shindex 528388073..9db5c8185 100755--- a/Docker/entrypoint.sh+++ b/Docker/entrypoint.sh@@ -8,7 +8,7 @@ chmod -R g+r . && chmod -R g+w ./data/find /etc/php*/ -name php.ini -exec sed -r -i "\#^;?date.timezone#s#^.*#date.timezone = $TZ#" {} \;if [ -n "$CRON_MIN" ]; then- sed -r -i "\#FreshRSS#s#^[^ ]+ #$CRON_MIN #" /var/spool/cron/crontabs/root+ crontab -l | sed -r "\#FreshRSS#s#^[^ ]+ #$CRON_MIN #" | crontab -fiexec "$@"