diff --git a/docker/dolibarr.ini b/docker/dolibarr.ini index cc3786d4f1981df53a62b71cbd55b2a0a20df314..5792be5eecf7ac6619a46b056b5944498ce7dda3 100644 --- a/docker/dolibarr.ini +++ b/docker/dolibarr.ini @@ -10,6 +10,22 @@ max_input_vars = 100000; upload_max_filesize = 200M ; Must be greater than or equal to upload_max_filesize post_max_size = 200M + +; Enable Opcache +opcache.enable=1 +; Set the memory size for the Opcache (e.g., 128MB) +opcache.memory_consumption=512 +; Set the maximum number of scripts to cache +opcache.max_accelerated_files=10000 +; Set the cache validity time in seconds +opcache.revalidate_freq=2 +; Enable file validation for updated scripts +opcache.validate_timestamps=1 +; Set the timeout for a request before it is terminated +opcache.max_file_size=2M +; Enable opcache for the CLI +opcache.enable_cli=1 + [xdebug] xdebug.client_port=9000 xdebug.mode=debug diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index cd5d28c635d22d5a5e4ab765ed83ac63f7b349c3..955f07008a18b87c53e10d7e1e10eb4f38200893 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -12,26 +12,10 @@ if [ "$ENV" == "prod" ]; then sed -i '/\(xdebug.*\)/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini sed -i '/error/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini apt-get purge -y php-xdebug php$PHP_VER-xdebug - cat <<EOF>>/etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini -; Enable Opcache -opcache.enable=1 -; Set the memory size for the Opcache (e.g., 128MB) -opcache.memory_consumption=512 -; Set the maximum number of scripts to cache -opcache.max_accelerated_files=10000 -; Set the cache validity time in seconds -opcache.revalidate_freq=2 -; Enable file validation for updated scripts -opcache.validate_timestamps=1 -; Set the timeout for a request before it is terminated -opcache.max_file_size=2M -; Enable opcache for the CLI -opcache.enable_cli=1 -EOF else - apt-get purge -y php-opcache php-memcached - sed -i 'd/Expires//' /etc/apache2/sites-enabled/000-default.conf - sed -i 'd/AddOutputFilterByType//' /etc/apache2/sites-enabled/000-default.conf + sed -i '/opcache/d' /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini + sed -i '/Expires/d' /etc/apache2/sites-enabled/000-default.conf + sed -i '/AddOutputFilterByType/d' /etc/apache2/sites-enabled/000-default.conf fi cp /etc/php/$PHP_VER/fpm/conf.d/00-dolibarr.ini /etc/php/$PHP_VER/cli/conf.d/00-dolibarr.ini echo "*/5 * * * * www-data /usr/bin/php /var/www/dolibarr/scripts/cron/cron_run_jobs.php $CRON_KEY $CRON_USER > /var/www/dolibarr/documents/cron_run_jobs.php.log" >> /etc/crontab