2019-09-23 19:56:18 +08:00
|
|
|
|
version: '2'
|
2018-02-21 18:06:05 +08:00
|
|
|
|
services:
|
|
|
|
|
nginx:
|
2020-11-24 15:45:42 +08:00
|
|
|
|
image: nginx:alpine
|
|
|
|
|
restart: always
|
2018-02-21 18:06:05 +08:00
|
|
|
|
# 端口映射
|
|
|
|
|
ports:
|
|
|
|
|
- "80:80"
|
|
|
|
|
# 依赖关系 先跑php
|
2020-11-24 15:45:42 +08:00
|
|
|
|
# depends_on:
|
|
|
|
|
# - "php"
|
2018-02-21 18:06:05 +08:00
|
|
|
|
# 数据卷
|
|
|
|
|
volumes:
|
|
|
|
|
# 映射主机./conf.d目录到容器/etc/nginx/conf.d目录
|
2022-10-07 09:00:07 +08:00
|
|
|
|
- "/srv/hd/pub/docker/dco/web/nginx/conf.d:/etc/nginx/conf.d"
|
2022-01-02 17:22:14 +08:00
|
|
|
|
- "/srv/hd/pub/web/80:/var/www/html"
|
2018-02-21 18:06:05 +08:00
|
|
|
|
networks:
|
2020-11-24 15:45:42 +08:00
|
|
|
|
- web_net
|
2022-01-02 17:22:14 +08:00
|
|
|
|
# networks:
|
|
|
|
|
# web_net:
|
|
|
|
|
# ipv4_address: 192.168.222.120
|
2018-02-21 18:06:05 +08:00
|
|
|
|
# 容器名称
|
2020-11-24 15:45:42 +08:00
|
|
|
|
container_name: "web_nginx"
|
2018-02-21 18:06:05 +08:00
|
|
|
|
php:
|
2020-11-24 15:45:42 +08:00
|
|
|
|
build: ./php-mysql
|
|
|
|
|
# image: php:fpm-alpine
|
|
|
|
|
restart: always
|
|
|
|
|
# ports:
|
|
|
|
|
# - "9000:9000"
|
2018-02-21 18:06:05 +08:00
|
|
|
|
volumes:
|
2022-01-02 17:22:14 +08:00
|
|
|
|
- "/srv/hd/pub/web/80:/var/www/html"
|
2018-02-21 18:06:05 +08:00
|
|
|
|
networks:
|
2020-11-24 15:45:42 +08:00
|
|
|
|
- web_net
|
|
|
|
|
container_name: "php-fpm"
|
|
|
|
|
# mysql:
|
|
|
|
|
# image: mysql:5.7
|
|
|
|
|
# ports:
|
|
|
|
|
# - "3306:3306"
|
|
|
|
|
# # 环境变量
|
|
|
|
|
# environment:
|
|
|
|
|
# # mysql密码
|
|
|
|
|
# - MYSQL_ROOT_PASSWORD=lldlcj123
|
|
|
|
|
# networks:
|
|
|
|
|
# web_net:
|
|
|
|
|
# # 固定子网ip,网段必须在子网络192.168.8.*
|
|
|
|
|
# ipv4_address: 192.168.8.6
|
|
|
|
|
# container_name: "compose-mysql"
|
2022-01-02 17:22:14 +08:00
|
|
|
|
|
2018-02-21 18:06:05 +08:00
|
|
|
|
networks:
|
|
|
|
|
# 配置docker network
|
2020-11-24 15:45:42 +08:00
|
|
|
|
web_net:
|
2022-01-02 17:22:14 +08:00
|
|
|
|
|
|
|
|
|
# networks:
|
|
|
|
|
# # 配置docker network
|
|
|
|
|
# web_net:
|
|
|
|
|
# driver: macvlan
|
|
|
|
|
# driver_opts:
|
|
|
|
|
# parent: ens18
|
|
|
|
|
# ipam:
|
|
|
|
|
# driver: default
|
|
|
|
|
# config:
|
|
|
|
|
# - subnet: 192.168.222.0/23
|
|
|
|
|
# gateway: 192.168.222.254
|