I'm creating a cluster with my php-fpm compiled from source image and the nginx official image, but when I try to run a phpinfo() file the nginx returns the error below:
*5 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: localhost, request: "GET /phpinfo.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:8000"
The docker-compose.yml file:
version: '2'
services:
php:
restart: always
build: data/php
image: php:7.1
ports:
- "9000:9000"
expose:
- 9000
volumes:
- ./app:/usr/share/nginx/html
web:
restart: always
build: data/nginx
image: nginx:1.10.2
ports:
- "8000:80"
links:
- php
volumes:
- ./data/nginx/vhost.conf:/etc/nginx/conf.d/default.conf
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./app:/usr/share/nginx/html
- ./data/log/nginx:/var/log/nginx
I checked the 9000 port in my host and the netstat -an | grep :9000
command and the port are alive:
tcp6 0 0 :::9000 :::* OUÇA
For more details see the files in this github repo (with the Dockerfile for that images):