为了账号安全,请及时绑定邮箱和手机立即绑定

docker-compose.yml中php-fpm服务启动exit with code 0?

docker-compose.yml中php-fpm服务启动exit with code 0?

PHP
慕仙森 2019-03-08 18:50:25
docker-compose.yml version: '2.1' services: nginx: image: 'nginx' ports: - "80:80" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./src:/var/www/app depends_on: - php php: image: 'php:7.1-fpm' ports: - "9000:9000" volumes: - ./src:/var/www/app - ./php/php-fpm.conf:/usr/local/etc/php-fpm.conf php-fpm.conf [global] pid = /var/run/php-fpm.pid error_log = /var/log/php-fpm.log log_level = notice [www] listen = 127.0.0.1:9000 listen.backlog = -1 ; listen.allowed_clients = 127.0.0.1 listen.owner = www-data listen.group = www-data listen.mode = 0666 user = www-data group = www-data pm = dynamic pm.max_children = 60 pm.start_servers = 30 pm.min_spare_servers = 30 pm.max_spare_servers = 60 request_terminate_timeout = 100 request_slowlog_timeout = 0 slowlog = var/log/slow.log Problem PS D:\SalamanderDocker> docker-compose up Starting salamanderdocker_php_1 ... Starting salamanderdocker_php_1 ... done Starting salamanderdocker_nginx_1 ... Starting salamanderdocker_nginx_1 ... done Attaching to salamanderdocker_php_1, salamanderdocker_nginx_1 salamanderdocker_php_1 exited with code 0 nginx_1 | 2017/10/18 04:36:48 [emerg] 1#1: host not found in upstream "php" in /etc/nginx/nginx.conf:42 nginx_1 | nginx: [emerg] host not found in upstream "php" in /etc/nginx/nginx.conf:42 salamanderdocker_nginx_1 exited with code 1 知道docker是需要一个进程挂在那边的,那这里是什么原因呢?
查看完整描述

2 回答

?
郎朗坤

TA贡献1921条经验 获得超9个赞

因为nginx进程报错了,所以导致进程退出了。

把你的nginx的配置文件贴一下看看。

查看完整回答
反对 回复 2019-03-18
  • 2 回答
  • 0 关注
  • 2419 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信