docker icon indicating copy to clipboard operation
docker copied to clipboard

FPM Listen on UNIX Socket

Open DaAwesomeP opened this issue 3 years ago • 1 comments

Hello,

It would be great if FPM listened on a UNIX socket too. The user can make this socket accessible outside of the container via a volume. Accessing FPM via UNIX socket is often faster than TCP sockets, and it can assist with scaling, as you do not need to worry about incrementing port numbers. It also lowers the chance of accidentally exposing FPM to the internet.

I would have submitted a pull, but I was unsure what the preferred way to make a modification to /usr/local/etc/php-fpm.d/www.conf is. An additional line in the [www] section would need to be added that looks like:

listen = /var/run/php-fpm/php-fpm.sock

DaAwesomeP avatar Jan 10 '21 19:01 DaAwesomeP

You can easily mount you own config into /usr/local/etc/php-fpm.d/, but UNIX socket are not really made for containers. You can scale the application by spawning additional containers and balance the load between them.

J0WI avatar Mar 24 '21 22:03 J0WI