Skip to content

Commit

Permalink
Fix #3 - Support CRONs
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Aug 29, 2024
1 parent 009dc91 commit 4592b1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 5 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,7 +31,7 @@ RUN set -eux; \
cd $WEB_DOCUMENT_ROOT; \
# curl -# -L -o - https://patch-diff.githubusercontent.com/raw/liuch/dmarc-srg/pull/<pr-id>.diff | patch -p1; \
rm -vr *.md; \
tree
tree;

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

Expand Down
1 change: 1 addition & 0 deletions docker/crontab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@hourly php -f /var/www/html/utils/fetch_reports.php

0 comments on commit 4592b1b

Please sign in to comment.