How php-fpm container communicates with nginx on host?

Viewed 29

I have installed nginx, php and php-fpm on server and my website is working fine. I am trying to containerise only php files. It should be in a way that nginx should stop communicating with my host php and nginx should connect to php-fpm container and my website should work fine. I need to communicate them via TCP.

I am using php:7.1-fpm as base image and copying all php files in Dockerfile.

my questions is what will be the "listen" value in php-fpm pool configuration for the container?

If both are in the same server, the listen value will be 127.0.0.1:9000. but it’s not the case here.

I know that the "listen" value in php-fpm pool configuration and "fastcgi_pass" in the nginx configuration should be the same.

Here the nginx is in the host and php-fpm is a container. I tried to use X.X.X.X:9000 (X.X.X.X is the ip of host) but i am getting errors like

ERROR: failed to post process the configuration

ERROR: FPM initialization failed

can anyone help me

0 Answers
Related