Compare commits

...

6 commits
3.20.6 ... main

Author SHA1 Message Date
8c243c43cb Merge pull request 'update base image' (#1) from feature/update-base-3.20.8 into main
Reviewed-on: #1
Reviewed-by: emanuel.holzmann <emanuel.holzmann@noreply.localhost>
2025-02-28 14:45:20 +01:00
4bffd3a1ef update base image 2025-02-28 14:44:22 +01:00
4b006a54d6 Update Dockerfile 2025-02-02 15:08:19 +01:00
50ab1e5ff1 Update README.md 2025-01-23 22:09:54 +01:00
b0ef861e79 Fix the command to crontab 2025-01-22 17:04:45 +01:00
bd83409469 Update Dockerfile 2025-01-22 12:49:04 +01:00
3 changed files with 26 additions and 3 deletions

View file

@ -1,5 +1,11 @@
ARG VERSION=3.20.6
FROM git.h2-invent.com/public-system-design/alpine-php8-webserver:${VERSION}
FROM git.h2-invent.com/public-system-design/alpine-php8-webserver:3.20.8
ARG VERSION
LABEL Version="${VERSION}" \
Maintainer="H2 invent GmbH <support@h2-invent.com>" \
Description="Lightweight container with Nginx & PHP-FPM & SUPERCRONIC based on Alpine Linux." \
org.opencontainers.version="${VERSION}" \
org.opencontainers.image.title="Lightweight container with Nginx & PHP-FPM & SUPERCRONIC based on Alpine Linux."
USER root

View file

@ -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"
```

View file

@ -2,6 +2,6 @@
# Schleife über alle ENV-Variablen, die mit VAR_ beginnen
env | grep '^CRON_COMMAND_' | while IFS= read -r line; do
echo "$line" >> /var/crontab
echo "$line" | cut -d "=" -f2 >> /var/crontab
echo "" >> /var/crontab
done