2024-11-18 15:35:34 +01:00
|
|
|
ARG VERSION
|
2024-11-18 18:22:19 +01:00
|
|
|
ARG SUPERCRONIC_VERSION=v0.2.33
|
2024-11-18 15:35:34 +01:00
|
|
|
ARG PHP_IMAGE_VERSION=3.20.5
|
2024-11-15 08:28:32 +01:00
|
|
|
|
2024-11-18 15:35:34 +01:00
|
|
|
FROM erseco/alpine-php-webserver:${PHP_IMAGE_VERSION}
|
2024-11-15 08:28:32 +01:00
|
|
|
|
|
|
|
LABEL version="${VERSION}" \
|
|
|
|
Maintainer="H2 invent GmbH" \
|
|
|
|
Description="Docker Image der Anwendung Open Datenschutzcenter" \
|
|
|
|
org.opencontainers.version="${VERSION}" \
|
|
|
|
org.opencontainers.image.title="Open Datenschutzcenter" \
|
|
|
|
org.opencontainers.image.license="AGPLv3" \
|
|
|
|
org.opencontainers.image.vendor="H2 invent GmbH" \
|
|
|
|
org.opencontainers.image.authors="Andreas Holzmann <support@h2-invent.com>" \
|
|
|
|
org.opencontainers.image.source="https://github.com/h2-invent/open-datenschutzcenter" \
|
|
|
|
org.opencontainers.image.documentation="https://open-datenschutzcenter.de" \
|
|
|
|
org.opencontainers.image.url="https://open-datenschutzcenter.de"
|
|
|
|
|
|
|
|
USER root
|
|
|
|
RUN apk --no-cache add \
|
|
|
|
unzip \
|
|
|
|
sqlite \
|
|
|
|
php83-sqlite3 \
|
|
|
|
php83-pdo_sqlite
|
|
|
|
|
2024-11-17 00:15:07 +01:00
|
|
|
RUN mkdir /etc/service/cron \
|
2024-11-17 00:12:46 +01:00
|
|
|
&& echo "#!/bin/sh" > /etc/service/cron/run \
|
2024-11-17 00:22:12 +01:00
|
|
|
&& echo "exec 2>&1 /supercronic /var/crontab" >> /etc/service/cron/run \
|
2024-11-17 00:12:46 +01:00
|
|
|
&& chown -R nobody:nobody /etc/service/cron \
|
|
|
|
&& chmod -R +x /etc/service/cron
|
2024-11-16 23:15:39 +01:00
|
|
|
|
2024-11-18 18:22:19 +01:00
|
|
|
RUN wget https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-amd64 -O /supercronic \
|
2024-11-17 00:12:05 +01:00
|
|
|
&& chmod +x /supercronic
|
2024-11-15 08:28:32 +01:00
|
|
|
|
2024-11-15 19:30:43 +01:00
|
|
|
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
|
|
|
|
|
2024-11-17 00:12:05 +01:00
|
|
|
RUN echo "# Docker Cron Jobs" > /var/crontab \
|
|
|
|
&& echo "SHELL=/bin/sh" >> /var/crontab \
|
2024-11-17 00:22:22 +01:00
|
|
|
&& echo "* * * * * date" >> /var/crontab \
|
2024-11-17 00:12:05 +01:00
|
|
|
&& echo "0 1 * * * curl https://open-datenschutzcenter.de/health/check" >> /var/crontab \
|
2024-11-18 15:35:34 +01:00
|
|
|
&& echo "0 9 * * 1-5 /bin/sh /distributed_cron.sh 'data/cron_log' 'php /var/www/html/bin/console app:cron'" >> /var/crontab \
|
2024-11-17 00:12:05 +01:00
|
|
|
&& echo "" >> /var/crontab
|
2024-11-16 22:39:00 +01:00
|
|
|
|
|
|
|
RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \
|
2024-11-18 15:35:34 +01:00
|
|
|
&& echo "php bin/console cache:clear" >> /docker-entrypoint-init.d/01-symfony.sh \
|
|
|
|
&& echo "php bin/console doc:mig:mig --no-interaction" >> /docker-entrypoint-init.d/01-symfony.sh \
|
|
|
|
&& echo "php bin/console cache:clear" >> /docker-entrypoint-init.d/01-symfony.sh \
|
2024-11-16 22:39:00 +01:00
|
|
|
&& chmod +x /docker-entrypoint-init.d/01-symfony.sh
|
|
|
|
|
2024-11-15 08:28:32 +01:00
|
|
|
RUN wget https://github.com/H2-invent/open-datenschutzcenter/releases/download/${VERSION}/application.zip -O artifact.zip \
|
|
|
|
&& unzip artifact.zip -d ${WEBDIR} \
|
2024-11-18 15:35:34 +01:00
|
|
|
&& chown -R nobody public \
|
|
|
|
&& chown -R nobody var \
|
|
|
|
&& chmod -R 700 public \
|
|
|
|
&& chmod -R 700 var
|
2024-11-15 08:28:32 +01:00
|
|
|
|
|
|
|
RUN apk del unzip \
|
|
|
|
&& rm artifact.zip \
|
2024-11-18 15:35:34 +01:00
|
|
|
&& rm -r var/cache \
|
2024-11-15 08:28:32 +01:00
|
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
|
|
|
|
USER nobody
|
|
|
|
|
|
|
|
ENV nginx_root_directory=/var/www/html/public \
|
2024-11-15 08:28:15 +01:00
|
|
|
upload_max_filesize=10M
|