I am creating a Docker image that run NginX and PHP-FPM (with Supervisor). The container is run as www-data, but the PHP-FPM socket is not created.

Here are my config files :


listen = /var/run/php/php7.3-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

user = www-data
group = www-data

pm = ondemand
pm.max_children = 72
pm.process_idle_timeout = 10s;
pm.max_requests = 1000


server {
    location ~ \.php$ {
        try_files $uri $uri/ /doku.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REDIRECT_STATUS 200;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;

Supervisor conf : PHP-FPM


Supervisor conf : NginX

command=nginx -g "daemon off;"


file=/opt/run/supervisord.sock   ; (the path to the socket file)
username = dummy
password = dummy

logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
loglevel=info                ; (log level;default info; others: debug,warn,trace)
user = www-data
pidfile = /opt/run/supervisord.pid

supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

serverurl=unix:///run/supervisord.sock ; use a unix:// URL  for a unix socket
username = dummy
password = dummy

files = /etc/supervisor/conf.d/*.conf

Thank you by advance

  • 1
    Why a single container? The normal approach is to create separate containers for nginx and php-fpm. – Michael Hampton Apr 14 at 19:41
  • Yes, it's true, but In my case, I need this approach becase I am creating microservices and I use Gravitee.io + Consul.io. To use the load balancing system with Gravitee and Consul, I need PHP-FPM and NginX on a single container – M4kn4sh Apr 14 at 20:26
  • Huh? Are you following some documentation? I can't find any example for gravitee or consul which requires php-fpm? – Michael Hampton Apr 14 at 20:35
  • No, microservices are developed in PHP. Before Gravitee, I had several php-fpm containers and one nginx container. In this case, if I want to use health checks with Gravitee, it was more difficult. – M4kn4sh Apr 14 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.