Answer the question
In order to leave comments, you need to log in
What is my docker-compose config error?
Hello. I have docker-compose.yml with the following content:
version: '3'
services:
nginx:
image: nginx:latest
ports:
- 80:80
volumes:
- ./:/var/www/html
- ./docker/conf/nginx:/etc/nginx/conf.d
- ./docker/nginx/logs:/var/log/nginx/
php:
build:
dockerfile: Dockerfile
context: ./
volumes:
- ./:/var/www/html
db:
image: mysql:latest
environment:
MYSQL_DATABASE: food
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: user
MYSQL_PASSWORD: user
ports:
- 3306:3306
volumes:
- db_data:/var/lib/mysql
volumes:
db_data:
2020/12/07 06:09:20 [crit] 19#19: *2 connect() to `unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client`: 172.21.0.1, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "localhost"
Answer the question
In order to leave comments, you need to log in
docker exec -it php ls -l /var/run/
docker exec -it nginx ls -l /var/run/
if you use a socket, then it must be forwarded to the nginx container
---
listen = /var/run/php-fpm.sock
---
---
fastcgi_pass unix:/var/run/php-fpm.sock;
---
---
listen = 0.0.0.0:9000
---
---
fastcgi_pass php:9000;
---
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question