docker-compose.yml中php-fpm服务启动exit with code 0?
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是需要一个进程挂在那边的,那这里是什么原因呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因为
nginx
进程报错了,所以导致进程退出了。把你的
nginx
的配置文件贴一下看看。php 域名没找到, 连接到php容器出了问题
看一下这个: https://stackoverflow.com/que...