Update README.md
This commit is contained in:
parent
b0ef861e79
commit
50ab1e5ff1
1 changed files with 17 additions and 0 deletions
17
README.md
17
README.md
|
@ -1,2 +1,19 @@
|
|||
# alpine-php8-cron-webserver
|
||||
|
||||
Cron Commands können per Crontab in einem Dockerfile erstellt werden. Dafür müssen die Cronjobs in /var/crontab eingefügt werden:
|
||||
|
||||
```
|
||||
RUN echo "# Docker Cron Jobs" > /var/crontab \
|
||||
&& echo "SHELL=/bin/sh" >> /var/crontab \
|
||||
&& echo "TZ=Europe/Berlin" >> /var/crontab \
|
||||
&& echo "*/10 * * * * /bin/sh /distributed_cron.sh '/var/www/html/data/cron_lock' 'php /var/www/html/bin/console cron:run'" >> /var/crontab \
|
||||
&& echo "" >> /var/crontab \
|
||||
&& chown nobody:nobody /var/crontab
|
||||
```
|
||||
|
||||
Oder die Cronjobs könnern per ENV eingefügt werden:
|
||||
|
||||
```
|
||||
ENV CRON_COMMAND_0="*/10 * * * * /bin/sh /distributed_cron.sh '/var/www/html/data/cron_lock' 'php /var/www/html/bin/console cron:run'"
|
||||
ENV CRON_COMMAND_1="0 0 * * * date"
|
||||
```
|
Loading…
Reference in a new issue