update from image version

This commit is contained in:
holzi1005 2024-11-18 15:35:34 +01:00
parent 8f6dab7130
commit 71d82290a6

View file

@ -1,7 +1,8 @@
FROM erseco/alpine-php-webserver:3.20.5 ARG VERSION
ARG SUPERCRONIC_VERSION=0.2.33
ARG PHP_IMAGE_VERSION=3.20.5
ARG VERSION= FROM erseco/alpine-php-webserver:${PHP_IMAGE_VERSION}
ARG WEBDIR=/var/www/html
LABEL version="${VERSION}" \ LABEL version="${VERSION}" \
Maintainer="H2 invent GmbH" \ Maintainer="H2 invent GmbH" \
@ -28,7 +29,7 @@ RUN mkdir /etc/service/cron \
&& chown -R nobody:nobody /etc/service/cron \ && chown -R nobody:nobody /etc/service/cron \
&& chmod -R +x /etc/service/cron && chmod -R +x /etc/service/cron
RUN wget https://github.com/aptible/supercronic/releases/download/v0.2.33/supercronic-linux-amd64 -O /supercronic \ RUN wget https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-amd64 -O /supercronic \
&& chmod +x /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 \ RUN wget https://git.h2-invent.com/Public-System-Design/Public-Helperscripts/raw/branch/main/distributed_cron.sh -O /distributed_cron.sh \
@ -38,25 +39,25 @@ RUN echo "# Docker Cron Jobs" > /var/crontab \
&& echo "SHELL=/bin/sh" >> /var/crontab \ && echo "SHELL=/bin/sh" >> /var/crontab \
&& echo "* * * * * date" >> /var/crontab \ && echo "* * * * * date" >> /var/crontab \
&& echo "0 1 * * * curl https://open-datenschutzcenter.de/health/check" >> /var/crontab \ && echo "0 1 * * * curl https://open-datenschutzcenter.de/health/check" >> /var/crontab \
&& echo "0 9 * * 1-5 /bin/sh /distributed_cron.sh '${WEBDIR}/data/cron_log' 'php ${WEBDIR}/bin/console app:cron'" >> /var/crontab \ && echo "0 9 * * 1-5 /bin/sh /distributed_cron.sh 'data/cron_log' 'php /var/www/html/bin/console app:cron'" >> /var/crontab \
&& echo "" >> /var/crontab && echo "" >> /var/crontab
RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \ RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \
&& echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/01-symfony.sh \ && echo "php bin/console cache:clear" >> /docker-entrypoint-init.d/01-symfony.sh \
&& echo "php ${WEBDIR}/bin/console doc:mig:mig --no-interaction" >> /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 ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/01-symfony.sh \ && echo "php bin/console cache:clear" >> /docker-entrypoint-init.d/01-symfony.sh \
&& chmod +x /docker-entrypoint-init.d/01-symfony.sh && chmod +x /docker-entrypoint-init.d/01-symfony.sh
RUN wget https://github.com/H2-invent/open-datenschutzcenter/releases/download/${VERSION}/application.zip -O artifact.zip \ RUN wget https://github.com/H2-invent/open-datenschutzcenter/releases/download/${VERSION}/application.zip -O artifact.zip \
&& unzip artifact.zip -d ${WEBDIR} \ && unzip artifact.zip -d ${WEBDIR} \
&& chown -R nobody ${WEBDIR}/public \ && chown -R nobody public \
&& chown -R nobody ${WEBDIR}/var \ && chown -R nobody var \
&& chmod -R 700 ${WEBDIR}/public \ && chmod -R 700 public \
&& chmod -R 700 ${WEBDIR}/var && chmod -R 700 var
RUN apk del unzip \ RUN apk del unzip \
&& rm artifact.zip \ && rm artifact.zip \
&& rm -r ${WEBDIR}/var/cache \ && rm -r var/cache \
&& rm -rf /var/cache/apk/* && rm -rf /var/cache/apk/*
USER nobody USER nobody