Public-Dockerfiles/jitsi_admin_application_dockerfile.txt

90 lines
3.8 KiB
Text
Raw Normal View History

2024-11-15 19:56:18 +01:00
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 Jitsi Admin" \
org.opencontainers.version="${VERSION}" \
org.opencontainers.image.title="Jitsi Admin" \
org.opencontainers.image.license="AGPLv3" \
org.opencontainers.image.vendor="H2 invent GmbH" \
org.opencontainers.image.authors="Emanuel Holzmann <support@h2-invent.com>" \
org.opencontainers.image.source="https://github.com/h2-invent/jitsi-admin" \
org.opencontainers.image.documentation="https://meetling.de" \
org.opencontainers.image.url="https://jitsi-admin.de"
USER root
RUN apk --no-cache add \
unzip \
sqlite \
php83-sqlite3 \
php83-pdo_sqlite \
php83-ldap \
php83-xmlwriter \
php83-xsl \
php83-pcntl \
php83-posix \
2024-11-16 16:10:06 +01:00
php83-sockets \
&& rm -rf /var/cache/apk/*
RUN sed -i 's/^date.timezone=.*$/date.timezone="Europe\/Berlin"/' /etc/php83/conf.d/custom.ini
RUN echo "Europe/Berlin" > /etc/timezone
2024-11-15 19:56:18 +01:00
RUN wget https://github.com/aptible/supercronic/releases/download/v0.2.33/supercronic-linux-amd64 -O /supercronic \
&& chmod +x /supercronic
2024-11-17 00:35:53 +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-15 19:56:18 +01:00
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
2024-11-15 19:56:18 +01:00
RUN mkdir /etc/service/symfony_messenger \
&& echo "#!/bin/sh -e" > /etc/service/symfony_messenger/run \
&& echo "exec 2>&1 php -d memory_limit=-1 ${WEBDIR}/bin/console messenger:consume async --memory-limit=512m --env=prod" >> /etc/service/symfony_messenger/run \
&& chown -R nobody:nobody /etc/service/symfony_messenger \
&& chmod -R +x /etc/service/symfony_messenger
RUN echo "# Docker Cron Jobs" > /var/crontab \
&& echo "SHELL=/bin/sh" >> /var/crontab \
&& echo "TZ=Europe/Berlin" >> /var/crontab \
&& echo "*/10 * * * * /bin/sh /distributed_cron.sh '${WEBDIR}/data/cron_lock' 'php ${WEBDIR}/bin/console cron:run'" >> /var/crontab \
&& echo "" >> /var/crontab \
&& chown nobody:nobody /var/crontab
2024-11-15 19:56:18 +01:00
RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/02-theme.sh \
&& echo "if [ -d "${WEBDIR}/data/theme" ]" >> /docker-entrypoint-init.d/02-theme.sh \
&& echo "then" >> /docker-entrypoint-init.d/02-theme.sh \
2024-11-16 14:14:17 +01:00
&& echo " cp ${WEBDIR}/data/theme/*.json.signed ${WEBDIR}/theme/" >> /docker-entrypoint-init.d/02-theme.sh \
&& echo " cp -r ${WEBDIR}/data/theme/public/* ${WEBDIR}/public/" >> /docker-entrypoint-init.d/02-theme.sh \
&& echo "fi" >> /docker-entrypoint-init.d/02-theme.sh \
&& chmod +x /docker-entrypoint-init.d/02-theme.sh
2024-11-15 19:56:18 +01:00
RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/03-symfony.sh \
&& echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/03-symfony.sh \
&& echo "php ${WEBDIR}/bin/console doc:mig:mig --no-interaction" >> /docker-entrypoint-init.d/03-symfony.sh \
&& echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/03-symfony.sh \
&& chmod +x /docker-entrypoint-init.d/03-symfony.sh
2024-11-16 13:27:14 +01:00
RUN wget https://github.com/H2-invent/jitsi-admin/releases/download/${VERSION}/application.zip -O artifact.zip \
&& unzip artifact.zip -d ${WEBDIR} \
&& chown -R nobody public \
&& chown -R nobody theme \
&& chown -R nobody var \
&& chmod -R 700 public \
&& chmod -R 700 theme \
&& chmod -R 700 var
2024-11-15 19:56:18 +01:00
RUN apk del unzip \
&& rm artifact.zip \
2024-11-16 16:10:06 +01:00
&& rm -r var/cache
2024-11-15 19:56:18 +01:00
USER nobody
ENV nginx_root_directory=/var/www/html/public \
2024-11-15 08:28:15 +01:00
upload_max_filesize=10M