From 2fbc24808657467c53b8a7b96846416fc32197ca Mon Sep 17 00:00:00 2001 From: Sven Joder Date: Mon, 2 Sep 2024 11:06:05 +0200 Subject: [PATCH] enhance php config for docker files --- .env.test | 2 +- Dockerfile | 6 +++++- Makefile | 3 ++- dockerfiles/php/10-opcache.ini | 9 +++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 dockerfiles/php/10-opcache.ini diff --git a/.env.test b/.env.test index 73b1230..f66943c 100644 --- a/.env.test +++ b/.env.test @@ -4,7 +4,7 @@ APP_LOCALE=de APP_CACHE_DIR=/var/www/wirhub/var/cache PANTHER_APP_ENV=test PANTHER_NO_HEADLESS=true -PANTHER_CHROME_ARGUMENTS="--ignore-certificate-errors --disable-dev-shm-usage --log-level=DEBUG --log-path=/var/www/wirhub/var/log --user-data-dir=/var/www/wirhub/var/chrome --headless=old --window-size=1280,1100 --disable-gpu --remote-debugging-port=9222" +PANTHER_CHROME_ARGUMENTS="--ignore-certificate-errors --disable-dev-shm-usage --verbose --log-path=/var/www/wirhub/var/log --user-data-dir=/var/www/wirhub/var/chrome --headless=old --window-size=1280,1100 --disable-gpu --disable-extensions --remote-debugging-port=9222" PANTHER_EXTERNAL_BASE_URI=http://localhost PANTHER_NO_SANDBOX=1 PANTHER_WEB_SERVER_DIR=./public diff --git a/Dockerfile b/Dockerfile index f9cd0c1..69094d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,12 +62,16 @@ RUN sed -i 's/post_max_size = 8M/post_max_size = 64M/g' /etc/php/8.2/apache2/php RUN sed -i 's/;date.timezone =/date.timezone = Europe\/Berlin/g' /etc/php/8.2/cli/php.ini RUN sed -i 's/;date.timezone =/date.timezone = Europe\/Berlin/g' /etc/php/8.2/apache2/php.ini +RUN rm /etc/php/8.2/apache2/conf.d/10-opcache.ini +COPY dockerfiles/php/10-opcache.ini /etc/php/8.2/apache2/conf.d + + # vorerst die alte 00-default.conf löschen und ersetzen. so funktionert es ohne https RUN rm /etc/apache2/sites-available/000-default.conf COPY dockerfiles/virtual_hosts /etc/apache2/sites-available ### Configure Webserver -RUN echo "

Apache server started: cd /var/www/html/index.html

" > /var/www/html/index.html +RUN echo "

Webserver running

" > /var/www/html/index.html RUN a2enmod rewrite # setting the correct server timezone diff --git a/Makefile b/Makefile index 376912c..ab45229 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ init: - COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader + COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev COMPOSER_ALLOW_SUPERUSER=1 composer dump-env prod + COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload --no-dev --classmap-authoritative php bin/console doctrine:migrations:migrate --no-interaction php bin/console app:theme:refresh php bin/console app:update diff --git a/dockerfiles/php/10-opcache.ini b/dockerfiles/php/10-opcache.ini new file mode 100644 index 0000000..d52cbce --- /dev/null +++ b/dockerfiles/php/10-opcache.ini @@ -0,0 +1,9 @@ +; configuration for php opcache module +; priority=10 +zend_extension=opcache.so +opcache.jit=off +opcache.preload=/var/www/wirhub/config/preload.php +opcache.preload_user=www-data +opcache.memory_consumption=256 +opcache.max_accelerated_files=20000 +opcache.validate_timestamps=0 \ No newline at end of file