diff --git a/README.md b/README.md index 76d2f57..4c2c6df 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,14 @@ That will be moved to `${MAILBOXES_WHEN_DONE_MOVE_TO}` or `${MAILBOXES_WHEN_FAIL ## Usage +## Fetching reports + +A cron is located in `/var/spool/cron/crontabs/application` and will fetch reports hourly. +Feel free to mount another [crontab file](./docker/crontab) to `/var/spool/cron/crontabs/application` +See: [cron setup from the upstream image](https://github.com/webdevops/Dockerfile/issues/280) + +## Docker compose + ```yml version: "2.3" diff --git a/docker/Dockerfile b/docker/Dockerfile index 7198c8e..5ee7789 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,11 +12,14 @@ ENV WEB_DOCUMENT_INDEX="index.html" ENV php.variables_order="EGPCS" # Remove global logging -RUN sed -i '/access_log/d' /etc/nginx/nginx.conf +RUN set -eux; \ + sed -i '/access_log/d' /etc/nginx/nginx.conf; COPY nginx-host.conf /opt/docker/etc/nginx/vhost.common.d/20-nginx-host.conf COPY nginx-logs.conf /opt/docker/etc/nginx/conf.d/5-logs.conf COPY nginx-vhost.conf /opt/docker/etc/nginx/vhost.conf +# root:application +COPY --chown=root:1000 --chmod=0600 crontab /var/spool/cron/crontabs/application USER application WORKDIR $WEB_DOCUMENT_ROOT @@ -28,7 +31,7 @@ RUN set -eux; \ cd $WEB_DOCUMENT_ROOT; \ # curl -# -L -o - https://patch-diff.githubusercontent.com/raw/liuch/dmarc-srg/pull/.diff | patch -p1; \ rm -vr *.md; \ - tree + tree; COPY config.php /var/www/html/config/conf.php diff --git a/docker/crontab b/docker/crontab new file mode 100644 index 0000000..e39d9e6 --- /dev/null +++ b/docker/crontab @@ -0,0 +1 @@ +@hourly php -f /var/www/html/utils/fetch_reports.php