From 80ce79abb368288503d5267c843ff770ce98b33a Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 18:02:14 +0100 Subject: [PATCH 01/17] add oem image --- oem_application_dockerfile | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 oem_application_dockerfile diff --git a/oem_application_dockerfile b/oem_application_dockerfile new file mode 100644 index 0000000..3f04fe2 --- /dev/null +++ b/oem_application_dockerfile @@ -0,0 +1,56 @@ +FROM git.h2-invent.com/public-system-design/alpine-php7-webserver:main + +ARG VERSION +ARG SUPERCRONIC_VERSION=0.2.33 + +LABEL version="${VERSION}" \ + Maintainer="H2 invent GmbH" \ + Description="Docker Image der Anwendung Open Datenschutzcenter" \ + org.opencontainers.version="${VERSION}" \ + org.opencontainers.image.title="Open Event Manager" \ + org.opencontainers.image.license="Apache-2.0 license" \ + 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 \ + && rm -rf /var/cache/apk/* + +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 wget https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/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 echo "# Docker Cron Jobs" > /var/crontab \ + && echo "SHELL=/bin/sh" >> /var/crontab \ + && echo "*/10 * * * * /bin/sh /distributed_cron.sh '/var/www/html/data/cron_lock' 'php /var/www/html/bin/console app:cron'" >> /var/crontab \ + && echo "" >> /var/crontab + +RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \ + && 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 \ + && chmod +x /docker-entrypoint-init.d/01-symfony.sh + +USER nobody + +RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.zip -O artifact.zip \ + && unzip artifact.zip \ + && rm artifact.zip \ + && rm -r var/cache + +ENV nginx_root_directory=/var/www/html/public \ + upload_max_filesize=10M \ + date_timezone=Europe/Berlin -- 2.39.5 From f6a035838b39d7afbcc592def3b5271f0584a9c6 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 18:38:43 +0100 Subject: [PATCH 02/17] update --- oem_application_dockerfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index 3f04fe2..6eec4f5 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -19,6 +19,8 @@ USER root RUN apk --no-cache add \ unzip \ + nodejs \ + composer \ && rm -rf /var/cache/apk/* RUN mkdir /etc/service/cron \ @@ -46,8 +48,18 @@ RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \ USER nobody -RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.zip -O artifact.zip \ - && unzip artifact.zip \ +RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.tar.gz -O artifact.tar.gz \ + && tar --strip-components=1 -xvzf artifact.tar.gz + +RUN composer install \ + --optimize-autoloader \ + --no-interaction \ + --no-progress + +RUN npm install \ + && npm run build + +RUN rm -r node_modules \ && rm artifact.zip \ && rm -r var/cache -- 2.39.5 From 04024bf8786b0ee531be820e872d558347b163c8 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 18:42:53 +0100 Subject: [PATCH 03/17] update --- oem_application_dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index 6eec4f5..d514653 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -51,7 +51,8 @@ USER nobody RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.tar.gz -O artifact.tar.gz \ && tar --strip-components=1 -xvzf artifact.tar.gz -RUN composer install \ +RUN COMPOSER_MEMORY_LIMIT=-1 \ + composer install \ --optimize-autoloader \ --no-interaction \ --no-progress -- 2.39.5 From bc99491f6fa975eedc84458269e3469a5899d981 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 18:44:27 +0100 Subject: [PATCH 04/17] update composer --- oem_application_dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index d514653..53f8c0e 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -20,7 +20,6 @@ USER root RUN apk --no-cache add \ unzip \ nodejs \ - composer \ && rm -rf /var/cache/apk/* RUN mkdir /etc/service/cron \ @@ -52,7 +51,7 @@ RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/t && tar --strip-components=1 -xvzf artifact.tar.gz RUN COMPOSER_MEMORY_LIMIT=-1 \ - composer install \ + php composer.phar install \ --optimize-autoloader \ --no-interaction \ --no-progress -- 2.39.5 From 723fbfb511014f029aac9ce2a2f4d89b806803a3 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 18:47:44 +0100 Subject: [PATCH 05/17] unlimited memory --- oem_application_dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index 53f8c0e..c82722e 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -50,8 +50,7 @@ USER nobody RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.tar.gz -O artifact.tar.gz \ && tar --strip-components=1 -xvzf artifact.tar.gz -RUN COMPOSER_MEMORY_LIMIT=-1 \ - php composer.phar install \ +RUN php -d memory_limit=-1 composer.phar install \ --optimize-autoloader \ --no-interaction \ --no-progress -- 2.39.5 From 1e9f3bafb1b37ab3f79675b703b382db7948f94f Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 18:51:52 +0100 Subject: [PATCH 06/17] update git --- oem_application_dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index c82722e..e07761b 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -20,6 +20,7 @@ USER root RUN apk --no-cache add \ unzip \ nodejs \ + git \ && rm -rf /var/cache/apk/* RUN mkdir /etc/service/cron \ @@ -50,7 +51,8 @@ USER nobody RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.tar.gz -O artifact.tar.gz \ && tar --strip-components=1 -xvzf artifact.tar.gz -RUN php -d memory_limit=-1 composer.phar install \ +RUN php -d memory_limit=-1 \ + composer.phar install \ --optimize-autoloader \ --no-interaction \ --no-progress -- 2.39.5 From 074807aabdd9ac5ebd5a2ae6895046b074e181bb Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 19:32:17 +0100 Subject: [PATCH 07/17] update --- oem_application_dockerfile | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index e07761b..caff291 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -20,6 +20,7 @@ USER root RUN apk --no-cache add \ unzip \ nodejs \ + npm \ git \ && rm -rf /var/cache/apk/* @@ -46,24 +47,40 @@ RUN echo "#!/bin/sh" > /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 -USER nobody - RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.tar.gz -O artifact.tar.gz \ - && tar --strip-components=1 -xvzf artifact.tar.gz + && tar --strip-components=1 -xvzf artifact.tar.gz \ + && chown -R nobody public \ + && chown -R nobody var \ + && chmod -R 700 public \ + && chmod -R 700 var + +RUN mv /etc/php7/conf.d/custom.ini /etc/php7/custom.ini RUN php -d memory_limit=-1 \ composer.phar install \ --optimize-autoloader \ --no-interaction \ - --no-progress + --no-progress \ + --no-dev + +RUN mv /etc/php7/custom.ini /etc/php7/conf.d/custom.ini RUN npm install \ && npm run build +RUN apk del \ + unzip \ + nodejs \ + npm \ + git \ + && rm -rf /var/cache/apk/* + RUN rm -r node_modules \ - && rm artifact.zip \ + && rm artifact.tar.gz \ && rm -r var/cache +USER nobody + ENV nginx_root_directory=/var/www/html/public \ upload_max_filesize=10M \ date_timezone=Europe/Berlin -- 2.39.5 From 3e1bbd0d99991038a4647ede09ba0ff26654fc0f Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 19:33:58 +0100 Subject: [PATCH 08/17] update --- oem_application_dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index caff291..d876b32 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -50,9 +50,7 @@ RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \ RUN wget https://github.com/open-event-manager/open-event-manager/archive/refs/tags/${VERSION}.tar.gz -O artifact.tar.gz \ && tar --strip-components=1 -xvzf artifact.tar.gz \ && chown -R nobody public \ - && chown -R nobody var \ - && chmod -R 700 public \ - && chmod -R 700 var + && chmod -R 700 public RUN mv /etc/php7/conf.d/custom.ini /etc/php7/custom.ini -- 2.39.5 From 3cbbbec88ba987f4946dad50c52efd2f4f4bec70 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 20:27:05 +0100 Subject: [PATCH 09/17] update permissions --- oem_application_dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index d876b32..899572f 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -75,7 +75,9 @@ RUN apk del \ RUN rm -r node_modules \ && rm artifact.tar.gz \ - && rm -r var/cache + && rm -r var/cache \ + mkdir var \ + chown nobody var USER nobody -- 2.39.5 From ae68fca0a8f77e2cb1a5333cfad87b92bbe13de1 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 20:31:52 +0100 Subject: [PATCH 10/17] fix run --- oem_application_dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index 899572f..53b9230 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -76,8 +76,8 @@ RUN apk del \ RUN rm -r node_modules \ && rm artifact.tar.gz \ && rm -r var/cache \ - mkdir var \ - chown nobody var + && mkdir var \ + && chown nobody var USER nobody -- 2.39.5 From 05d9e5c69d27fb41d73f3aa5fd09d96bacff8f2f Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 20:35:23 +0100 Subject: [PATCH 11/17] fix permission --- oem_application_dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index 53b9230..52cd2b7 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -76,8 +76,7 @@ RUN apk del \ RUN rm -r node_modules \ && rm artifact.tar.gz \ && rm -r var/cache \ - && mkdir var \ - && chown nobody var + && chown -R nobody var USER nobody -- 2.39.5 From 7c77be887898cc6faef6c9197748a37cf6f91414 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 20:41:03 +0100 Subject: [PATCH 12/17] update --- oem_application_dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oem_application_dockerfile b/oem_application_dockerfile index 52cd2b7..846ae8f 100644 --- a/oem_application_dockerfile +++ b/oem_application_dockerfile @@ -82,4 +82,5 @@ USER nobody ENV nginx_root_directory=/var/www/html/public \ upload_max_filesize=10M \ - date_timezone=Europe/Berlin + date_timezone=Europe/Berlin \ + intl_default_locale=de_DE -- 2.39.5 From 382ef8ea63f309db2b52ec3d489b4ec5661ba03f Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 21:20:10 +0100 Subject: [PATCH 13/17] add stats image --- stats_application_dockerfile | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 stats_application_dockerfile diff --git a/stats_application_dockerfile b/stats_application_dockerfile new file mode 100644 index 0000000..2b415cc --- /dev/null +++ b/stats_application_dockerfile @@ -0,0 +1,56 @@ +ARG PHP_IMAGE_VERSION=3.20.6 +FROM erseco/alpine-php-webserver:${PHP_IMAGE_VERSION} + +ARG VERSION + +LABEL version="${VERSION}" \ + Maintainer="H2 invent GmbH" \ + Description="Stats Server" \ + org.opencontainers.version="${VERSION}" \ + org.opencontainers.image.title="Stats Server" \ + 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/ja-analystics" \ + org.opencontainers.image.documentation="https://h2-invent.com" \ + org.opencontainers.image.url="https://h2-invent.com" + +USER root + +RUN apk --no-cache add \ + git \ + && rm -rf /var/cache/apk/* + +RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \ + && 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 \ + && chmod +x /docker-entrypoint-init.d/01-symfony.sh + +RUN wget https://github.com/H2-invent/ja-analytics/archive/refs/heads/main.tar.gz -O artifact.tar.gz \ + && tar --strip-components=1 -xvzf artifact.tar.gz \ + && chown -R nobody public \ + && chmod -R 700 public + +RUN mv /etc/php83/conf.d/custom.ini /etc/php83/custom.ini + +RUN php -d memory_limit=-1 \ + composer.phar install \ + --optimize-autoloader \ + --no-interaction \ + --no-progress \ + --no-dev + +RUN mv /etc/php83/custom.ini /etc/php83/conf.d/custom.ini + +RUN rm -r node_modules \ + && rm artifact.tar.gz \ + && rm -r var/cache \ + && chown -R nobody var + +USER nobody + +ENV nginx_root_directory=/var/www/html/public \ + upload_max_filesize=10M \ + date_timezone=Europe/Berlin \ + intl_default_locale=de_DE -- 2.39.5 From 8414d282ec80ddecd84a24dd5e6cb3b948deb977 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 21:33:57 +0100 Subject: [PATCH 14/17] remove node_modules --- stats_application_dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stats_application_dockerfile b/stats_application_dockerfile index 2b415cc..50f584f 100644 --- a/stats_application_dockerfile +++ b/stats_application_dockerfile @@ -43,8 +43,7 @@ RUN php -d memory_limit=-1 \ RUN mv /etc/php83/custom.ini /etc/php83/conf.d/custom.ini -RUN rm -r node_modules \ - && rm artifact.tar.gz \ +RUN rm artifact.tar.gz \ && rm -r var/cache \ && chown -R nobody var -- 2.39.5 From 913fe42c728eb193679fce9d404dbfb52b49afab Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 21:54:50 +0100 Subject: [PATCH 15/17] add options --- stats_application_dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stats_application_dockerfile b/stats_application_dockerfile index 50f584f..6a4abeb 100644 --- a/stats_application_dockerfile +++ b/stats_application_dockerfile @@ -19,6 +19,11 @@ USER root RUN apk --no-cache add \ git \ + php83-xmlwriter \ + php83-xsl \ + php83-pcntl \ + php83-posix \ + php83-sockets \ && rm -rf /var/cache/apk/* RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/01-symfony.sh \ -- 2.39.5 From f390756fcad776275384d5a063bdb94084d3c7a6 Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 22:07:54 +0100 Subject: [PATCH 16/17] fix memory --- filemanager_application_dockerfile | 3 ++- stats_application_dockerfile | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/filemanager_application_dockerfile b/filemanager_application_dockerfile index af0996d..89defc3 100644 --- a/filemanager_application_dockerfile +++ b/filemanager_application_dockerfile @@ -70,4 +70,5 @@ ENV nginx_root_directory=/var/www/html/public \ memory_limit=1024M \ post_max_size=200M \ upload_max_filesize=200M \ - date_timezone=Europe/Berlin + date_timezone=Europe/Berlin \ + intl_default_locale=de_DE diff --git a/stats_application_dockerfile b/stats_application_dockerfile index 6a4abeb..b63ec89 100644 --- a/stats_application_dockerfile +++ b/stats_application_dockerfile @@ -55,6 +55,8 @@ RUN rm artifact.tar.gz \ USER nobody ENV nginx_root_directory=/var/www/html/public \ - upload_max_filesize=10M \ + memory_limit=1024M \ + post_max_size=200M \ + upload_max_filesize=200M \ date_timezone=Europe/Berlin \ intl_default_locale=de_DE -- 2.39.5 From fc77db782d29ce48e095abd24594627035fd747e Mon Sep 17 00:00:00 2001 From: holzi1005 Date: Tue, 3 Dec 2024 22:18:51 +0100 Subject: [PATCH 17/17] increase memory limit --- stats_application_dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stats_application_dockerfile b/stats_application_dockerfile index b63ec89..9e61b4c 100644 --- a/stats_application_dockerfile +++ b/stats_application_dockerfile @@ -55,8 +55,8 @@ RUN rm artifact.tar.gz \ USER nobody ENV nginx_root_directory=/var/www/html/public \ - memory_limit=1024M \ - post_max_size=200M \ - upload_max_filesize=200M \ + memory_limit=2048M \ + post_max_size=20M \ + upload_max_filesize=20M \ date_timezone=Europe/Berlin \ intl_default_locale=de_DE -- 2.39.5