From 3902256c9c1f85ed919fd23097b7a40f72dc5614 Mon Sep 17 00:00:00 2001 From: Jason Kendall Date: Mon, 24 Feb 2020 13:31:37 -0500 Subject: [PATCH] Move php config to a fpm entrypoint --- server/Dockerfile | 1 + server/files/entrypoint_nginx.sh | 12 ------------ server/files/etc/supervisor/supervisor.conf | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 035c764..c44383d 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -126,6 +126,7 @@ ARG PHP_VER # Entrypoints COPY files/etc/supervisor/supervisor.conf /etc/supervisor/conf.d/supervisord.conf + COPY files/entrypoint_fpm.sh / COPY files/entrypoint_nginx.sh / COPY files/entrypoint_cron.sh / COPY files/entrypoint_workers.sh / diff --git a/server/files/entrypoint_nginx.sh b/server/files/entrypoint_nginx.sh index c626f98..edba48f 100755 --- a/server/files/entrypoint_nginx.sh +++ b/server/files/entrypoint_nginx.sh @@ -12,17 +12,6 @@ MISP_APP_CONFIG_PATH=/var/www/MISP/app/Config ENTRYPOINT_PID_FILE="/entrypoint_apache.install" [ ! -f $ENTRYPOINT_PID_FILE ] && touch $ENTRYPOINT_PID_FILE -change_php_vars(){ - for FILE in /etc/php/*/fpm/php.ini - do - [[ -e $FILE ]] || break - sed -i "s/memory_limit = .*/memory_limit = 2048M/" "$FILE" - sed -i "s/max_execution_time = .*/max_execution_time = 300/" "$FILE" - sed -i "s/upload_max_filesize = .*/upload_max_filesize = 50M/" "$FILE" - sed -i "s/post_max_size = .*/post_max_size = 50M/" "$FILE" - done -} - setup_cake_config(){ sed -i "s/'host' => 'localhost'.*/'host' => '$REDIS_FQDN', \/\/ Redis server hostname/" "/var/www/MISP/app/Plugin/CakeResque/Config/config.php" } @@ -110,7 +99,6 @@ fi echo "Initialize misp base config..." && init_misp_config # Things that should ALWAYS happen -echo "Configure PHP | Change PHP values ..." && change_php_vars echo "Configure Cake | Change Redis host to $REDIS_FQDN ... " && setup_cake_config echo "Configure MISP | Enforce permissions ..." echo "... chown -R www-data.www-data /var/www/MISP ..." && find /var/www/MISP -not -user www-data -exec chown www-data.www-data {} + diff --git a/server/files/etc/supervisor/supervisor.conf b/server/files/etc/supervisor/supervisor.conf index f5cd065..ed23d98 100644 --- a/server/files/etc/supervisor/supervisor.conf +++ b/server/files/etc/supervisor/supervisor.conf @@ -15,7 +15,7 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 [program:php-fpm] -command=/usr/sbin/php-fpm7.3 -R -F +command=/entrypoint_fpm.sh process_name=%(program_name)s_%(process_num)02d numprocs=1 autostart=true