diff --git a/Dockerfile b/Dockerfile index 03f5e0a2..d5be6935 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,9 @@ RUN php artisan storage:link COPY nginx.conf /etc/nginx/nginx.conf COPY supervisord.conf /etc/supervisord.conf +COPY php-fpm-pool.conf /usr/local/etc/php-fpm.d/www.conf + +RUN mkdir -p /var/run && chmod 755 /var/run EXPOSE 8080 diff --git a/nginx.conf b/nginx.conf index 18d9f23e..eab49187 100644 --- a/nginx.conf +++ b/nginx.conf @@ -19,7 +19,7 @@ http { } location ~ \.php$ { - fastcgi_pass 127.0.0.1:9000; + fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; diff --git a/php-fpm-pool.conf b/php-fpm-pool.conf new file mode 100644 index 00000000..20d1ef6a --- /dev/null +++ b/php-fpm-pool.conf @@ -0,0 +1,12 @@ +[www] +user = nobody +group = nobody +listen = /var/run/php-fpm.sock +listen.owner = nobody +listen.group = nobody +listen.mode = 0660 +pm = dynamic +pm.max_children = 10 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 diff --git a/supervisord.conf b/supervisord.conf index dc05a200..e5e824ab 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -1,17 +1,31 @@ [supervisord] nodaemon=true +logfile=/dev/null +logfile_maxbytes=0 [program:php-fpm] command=/usr/local/sbin/php-fpm --nodaemonize autostart=true autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 [program:nginx] command=nginx -g "daemon off;" autostart=true autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 [program:reverb] command=php -d upload_max_filesize=50M -d post_max_size=55M -d memory_limit=256M /app/artisan reverb:start --host=0.0.0.0 --port=8085 autostart=true autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0