Skip to content

Commit 4592b1b

Browse files
committed
Fix #3 - Support CRONs
1 parent 009dc91 commit 4592b1b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ That will be moved to `${MAILBOXES_WHEN_DONE_MOVE_TO}` or `${MAILBOXES_WHEN_FAIL
3434

3535
## Usage
3636

37+
## Fetching reports
38+
39+
A cron is located in `/var/spool/cron/crontabs/application` and will fetch reports hourly.
40+
Feel free to mount another [crontab file](./docker/crontab) to `/var/spool/cron/crontabs/application`
41+
See: [cron setup from the upstream image](https://github.com/webdevops/Dockerfile/issues/280)
42+
43+
## Docker compose
44+
3745
```yml
3846
version: "2.3"
3947

docker/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ ENV WEB_DOCUMENT_INDEX="index.html"
1212
ENV php.variables_order="EGPCS"
1313

1414
# Remove global logging
15-
RUN sed -i '/access_log/d' /etc/nginx/nginx.conf
15+
RUN set -eux; \
16+
sed -i '/access_log/d' /etc/nginx/nginx.conf;
1617

1718
COPY nginx-host.conf /opt/docker/etc/nginx/vhost.common.d/20-nginx-host.conf
1819
COPY nginx-logs.conf /opt/docker/etc/nginx/conf.d/5-logs.conf
1920
COPY nginx-vhost.conf /opt/docker/etc/nginx/vhost.conf
21+
# root:application
22+
COPY --chown=root:1000 --chmod=0600 crontab /var/spool/cron/crontabs/application
2023

2124
USER application
2225
WORKDIR $WEB_DOCUMENT_ROOT
@@ -28,7 +31,7 @@ RUN set -eux; \
2831
cd $WEB_DOCUMENT_ROOT; \
2932
# curl -# -L -o - https://patch-diff.githubusercontent.com/raw/liuch/dmarc-srg/pull/<pr-id>.diff | patch -p1; \
3033
rm -vr *.md; \
31-
tree
34+
tree;
3235

3336
COPY config.php /var/www/html/config/conf.php
3437

docker/crontab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@hourly php -f /var/www/html/utils/fetch_reports.php

0 commit comments

Comments
 (0)