web/docker-compose.yml

63 lines
1.6 KiB
YAML
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '2'
services:
nginx:
image: nginx:alpine
restart: always
# 端口映射
ports:
- "80:80"
# 依赖关系 先跑php
# depends_on:
# - "php"
# 数据卷
volumes:
# 映射主机./conf.d目录到容器/etc/nginx/conf.d目录
- "/srv/hd/pub/docker/dco/web/nginx/conf.d:/etc/nginx/conf.d"
- "/srv/hd/pub/web/80:/var/www/html"
networks:
- web_net
# networks:
# web_net:
# ipv4_address: 192.168.222.120
# 容器名称
container_name: "web_nginx"
php:
# build: ./php-mysql
image: fpm-mysql
restart: always
# ports:
# - "9000:9000"
volumes:
- "/srv/hd/pub/web/80:/var/www/html"
networks:
- 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"
networks:
# 配置docker network
web_net:
# 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