alpine-php8-cron-webserver/Dockerfile
2025-02-28 14:44:22 +01:00

34 lines
1.3 KiB
Docker

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
RUN wget https://github.com/aptible/supercronic/releases/download/v0.2.33/supercronic-linux-amd64 -O /supercronic \
&& chmod +x /supercronic
RUN wget https://git.h2-invent.com/Public-System-Design/Public-Helperscripts/raw/branch/main/distributed_cron.sh -O /distributed_cron.sh \
&& chmod +x /distributed_cron.sh
RUN mkdir /etc/service/cron \
&& echo "#!/bin/sh" > /etc/service/cron/run \
&& echo "exec 2>&1 /supercronic /var/crontab" >> /etc/service/cron/run \
&& chown -R nobody:nobody /etc/service/cron \
&& chmod -R +x /etc/service/cron
RUN echo "# Docker Cron Jobs" > /var/crontab \
&& echo "SHELL=/bin/sh" >> /var/crontab \
&& echo "TZ=Europe/Berlin" >> /var/crontab \
&& echo "" >> /var/crontab \
&& chown nobody:nobody /var/crontab
COPY cron_create.sh /docker-entrypoint-init.d/00-cron_create.sh
RUN chmod +x /docker-entrypoint-init.d/00-cron_create.sh
USER nobody