docker
docker copied to clipboard
FPM Listen on UNIX Socket
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
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.