From 575683a36acea5fee7bb3eccc687d278794f637e Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Fri, 15 Nov 2024 08:28:32 +0100 Subject: [PATCH] Update odc_application_dockerfile.txt --- ...file.txt => odc_application_dockerfile.txt | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) rename odc_dockerfile.txt => odc_application_dockerfile.txt (96%) diff --git a/odc_dockerfile.txt b/odc_application_dockerfile.txt similarity index 96% rename from odc_dockerfile.txt rename to odc_application_dockerfile.txt index abd7913..4c783a6 100644 --- a/odc_dockerfile.txt +++ b/odc_application_dockerfile.txt @@ -1,63 +1,63 @@ -FROM erseco/alpine-php-webserver:3.20.5 - -ARG VERSION= -ARG WEBDIR=/var/www/html - -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 " \ - 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 \ - cronie \ - libcap \ - php83-sqlite3 \ - php83-pdo_sqlite - -RUN mkdir /etc/service/crond \ - && echo "#!/bin/sh -e" > /etc/service/crond/run \ - && echo "exec 2>&1 /usr/sbin/crond -f" >> /etc/service/crond/run \ - && chown -R nobody:nobody /etc/service/crond \ - && chmod -R +x /etc/service/crond \ - && chown nobody:nobody /usr/sbin/crond \ - && setcap cap_setgid=ep /usr/sbin/crond \ - && setcap cap_setuid=ep /usr/sbin/crond - -RUN echo "# Docker Cron Jobs" > /etc/crontabs/nobody \ - && echo "* * * * * curl http://localhost:8080/health/check > /dev/null > 2>&1" >> /etc/crontabs/nobody \ - && echo "0 1 * * * curl https://open-datenschutzcenter.de/health/check > /dev/null > 2>&1" >> /etc/crontabs/nobody \ - && chown nobody:nobody /etc/crontabs/nobody \ - && chmod +x /etc/crontabs/nobody - -RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/symfony.sh \ - && echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/symfony.sh \ - && echo "php ${WEBDIR}/bin/console doc:mig:mig --no-interaction" >> /docker-entrypoint-init.d/symfony.sh \ - && echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/symfony.sh \ - && chmod +x /docker-entrypoint-init.d/* - -RUN wget https://github.com/H2-invent/open-datenschutzcenter/releases/download/${VERSION}/application.zip -O artifact.zip \ - && unzip artifact.zip -d ${WEBDIR} \ - && chown -R nobody ${WEBDIR}/public \ - && chown -R nobody ${WEBDIR}/var \ - && chmod -R 700 ${WEBDIR}/public \ - && chmod -R 700 ${WEBDIR}/var - -RUN apk del unzip \ - && rm artifact.zip \ - && rm -r ${WEBDIR}/var/cache \ - && rm -rf /var/cache/apk/* - -USER nobody - -ENV nginx_root_directory=/var/www/html/public \ +FROM erseco/alpine-php-webserver:3.20.5 + +ARG VERSION= +ARG WEBDIR=/var/www/html + +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 " \ + 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 \ + cronie \ + libcap \ + php83-sqlite3 \ + php83-pdo_sqlite + +RUN mkdir /etc/service/crond \ + && echo "#!/bin/sh -e" > /etc/service/crond/run \ + && echo "exec 2>&1 /usr/sbin/crond -f" >> /etc/service/crond/run \ + && chown -R nobody:nobody /etc/service/crond \ + && chmod -R +x /etc/service/crond \ + && chown nobody:nobody /usr/sbin/crond \ + && setcap cap_setgid=ep /usr/sbin/crond \ + && setcap cap_setuid=ep /usr/sbin/crond + +RUN echo "# Docker Cron Jobs" > /etc/crontabs/nobody \ + && echo "* * * * * curl http://localhost:8080/health/check > /dev/null > 2>&1" >> /etc/crontabs/nobody \ + && echo "0 1 * * * curl https://open-datenschutzcenter.de/health/check > /dev/null > 2>&1" >> /etc/crontabs/nobody \ + && chown nobody:nobody /etc/crontabs/nobody \ + && chmod +x /etc/crontabs/nobody + +RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/symfony.sh \ + && echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/symfony.sh \ + && echo "php ${WEBDIR}/bin/console doc:mig:mig --no-interaction" >> /docker-entrypoint-init.d/symfony.sh \ + && echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/symfony.sh \ + && chmod +x /docker-entrypoint-init.d/* + +RUN wget https://github.com/H2-invent/open-datenschutzcenter/releases/download/${VERSION}/application.zip -O artifact.zip \ + && unzip artifact.zip -d ${WEBDIR} \ + && chown -R nobody ${WEBDIR}/public \ + && chown -R nobody ${WEBDIR}/var \ + && chmod -R 700 ${WEBDIR}/public \ + && chmod -R 700 ${WEBDIR}/var + +RUN apk del unzip \ + && rm artifact.zip \ + && rm -r ${WEBDIR}/var/cache \ + && rm -rf /var/cache/apk/* + +USER nobody + +ENV nginx_root_directory=/var/www/html/public \ upload_max_filesize=10M \ No newline at end of file