直接看docker-compose.yml配置文件
version: '3'
networks:
backend:
driver: bridge
# 定义四个服务nginx,php,mysql,redis
services:
nginx:
# 依赖php服务,意味着在启动nginx之前先启动php
depends_on:
- php-fpm
# nginx镜像的路径
image: registry.cn-shenzhen.aliyuncs.com/yxyong/nginx
volumes:
- ./website:/var/www:cached
- ./logs/nginx:/var/log/nginx
- ./conf/nginx/sites:/etc/nginx/sites-available
- ./conf/nginx/ssl:/etc/nginx/ssl
# nginx意外退出时自动重启
restart: always
# 映射80和443端口
ports:
- "80:80"
- "443:443"
# 容器名称
container_name: nginx
networks:
- backend
php-fpm:
depends_on:
- mysql
- redis
image: registry.cn-shenzhen.aliyuncs.com/yxyong/php
restart: always
volumes: