Docker+Nginx+php-fpm
(1)compose文件中区分大小写。
(2)networks块的值必须是列表。
php-fpm:
image: php:fpm-mysqli-gd
volumes:
- /path/to/www/:/var/www/html
networks:
- nginx
depends_on:
mariadb:
condition: service_healthy
healthcheck:
test: "nc -z localhost 9000"
interval: 5s
timeout: 5s
retries: 3
(3)网络在外面用命令建立不行,必须在compose file中申明,不然会提示“使用了未定义的网络”
networks:
nginx:
(4)php程序要挂到php-fpm的容器中,而不是nginx的容器中。这应该是我这样的白丁才会犯的错吧!。。。