Public-Dockerfiles/oem_application_dockerfile

68 lines
2.6 KiB
Text
Raw Normal View History

2024-12-03 18:02:14 +01:00
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 <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 \
2024-12-03 18:38:43 +01:00
nodejs \
2024-12-03 18:02:14 +01:00
&& 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
2024-12-03 18:38:43 +01:00
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
2024-12-03 18:47:44 +01:00
RUN php -d memory_limit=-1 composer.phar install \
2024-12-03 18:38:43 +01:00
--optimize-autoloader \
--no-interaction \
--no-progress
RUN npm install \
&& npm run build
RUN rm -r node_modules \
2024-12-03 18:02:14 +01:00
&& rm artifact.zip \
&& rm -r var/cache
ENV nginx_root_directory=/var/www/html/public \
upload_max_filesize=10M \
date_timezone=Europe/Berlin