Update skib_application_dockerfile.txt

This commit is contained in:
holzi1005 2024-11-17 13:01:41 +01:00
parent 5a91f6db76
commit 87abdc06fa

View file

@ -18,22 +18,32 @@ LABEL version="${VERSION}" \
USER root
RUN apk --no-cache add \
unzip \
cronie \
libcap
php83-xmlwriter \
php83-xsl \
php83-pcntl \
php83-posix \
php83-sockets \
&& rm -rf /var/cache/apk/*
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 sed -i 's/^date.timezone=.*$/date.timezone="Europe\/Berlin"/' /etc/php83/conf.d/custom.ini
RUN echo "Europe/Berlin" > /etc/timezone
RUN echo "# Docker Cron Jobs" > /etc/crontabs/nobody \
&& echo "*/10 * * * * php ${WEBDIR}/bin/console app:stats > /dev/null > 2>&1" >> /etc/crontabs/nobody \
&& chown nobody:nobody /etc/crontabs/nobody \
&& chmod +x /etc/crontabs/nobody
RUN wget https://github.com/aptible/supercronic/releases/download/v0.2.33/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 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 echo "# Docker Cron Jobs" > /var/crontab \
&& echo "*/10 * * * * php ${WEBDIR}/bin/console app:stats" >> /var/crontab \
&& echo "" >> /var/crontab \
&& chown nobody:nobody /var/crontab
#RUN echo "#!/bin/sh" > /docker-entrypoint-init.d/symfony.sh \
# && echo "php ${WEBDIR}/bin/console cache:clear" >> /docker-entrypoint-init.d/symfony.sh \
@ -62,4 +72,7 @@ RUN apk del unzip \
USER nobody
ENV nginx_root_directory=/var/www/html/public \
upload_max_filesize=10M
memory_limit=1024M \
post_max_size=20M \
upload_max_filesize=10M \
PHP_DATE_TIMEZONE="Europe/Berlin"