From 4381117a197efca11ce896791ef35c6e52c7130f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 26 Apr 2018 12:00:14 +0200 Subject: cron in Docker image (#1871) * cron in Docker image https://github.com/FreshRSS/FreshRSS/issues/1869 * Fix cron CMD * Minor readme * Docker run d instead of dit There should not be a need for STDIN or TTY * Minor sed param --- Docker/Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Docker/Dockerfile') diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 9b7336e3b..78a0f0e8f 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -15,8 +15,12 @@ WORKDIR ${FRESHRSS_ROOT} COPY . ${FRESHRSS_ROOT} COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/ +RUN echo "17,37 * * * * php ${FRESHRSS_ROOT}/app/actualize_script.php 2>&1 | tee /tmp/FreshRSS.log" >> \ + /var/spool/cron/crontabs/root + +ENV CRON_MIN '' +ENTRYPOINT ["./Docker/entrypoint.sh"] + EXPOSE 80 -CMD php -f ./cli/prepare.php > /dev/null && \ - chown -R :www-data ${FRESHRSS_ROOT} && \ - chmod -R g+r ${FRESHRSS_ROOT} && chmod -R g+w ${FRESHRSS_ROOT}/data/ && \ +CMD ([ -z "$CRON_MIN" ] || crond -d 6) && \ exec httpd -D FOREGROUND -- cgit v1.2.3 From 90998c24370ea14b2b78d1e2a55bfe33947b2aa7 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 26 Apr 2018 13:52:44 +0200 Subject: Apache overrides were not enough (#1873) It looks like overrides of CustomLog, ErrorLog, Listen did not do the job fully. Updated to comment out those lines in httpd.conf. Fixes the fact that logs were kept in /var/log/apache2/ (instead of being only given via STDOUT to Docker logs) and the "internal dummy connection" bug over IPv6 (Docker is typically only IPv4). --- Docker/Dockerfile | 5 +++-- Docker/FreshRSS.Apache.conf | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'Docker/Dockerfile') diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 78a0f0e8f..189d7175a 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -15,8 +15,9 @@ WORKDIR ${FRESHRSS_ROOT} COPY . ${FRESHRSS_ROOT} COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/ -RUN echo "17,37 * * * * php ${FRESHRSS_ROOT}/app/actualize_script.php 2>&1 | tee /tmp/FreshRSS.log" >> \ - /var/spool/cron/crontabs/root +RUN sed -r -i "/^[ ]*(CustomLog|ErrorLog|Listen) /s/^/#/" /etc/apache2/httpd.conf && \ + echo "17,37 * * * * php ${FRESHRSS_ROOT}/app/actualize_script.php 2>&1 | tee /tmp/FreshRSS.log" >> \ + /var/spool/cron/crontabs/root ENV CRON_MIN '' ENTRYPOINT ["./Docker/entrypoint.sh"] diff --git a/Docker/FreshRSS.Apache.conf b/Docker/FreshRSS.Apache.conf index 59151d749..adfc804c6 100644 --- a/Docker/FreshRSS.Apache.conf +++ b/Docker/FreshRSS.Apache.conf @@ -17,8 +17,8 @@ ServerName freshrss.localhost Listen 0.0.0.0:80 DocumentRoot /var/www/FreshRSS/p/ +CustomLog /dev/stdout combined ErrorLog /dev/stderr -TransferLog /dev/stdout AllowEncodedSlashes On -- cgit v1.2.3