version: '2'
services:
nginx:
image: nginx:1.16.1
container_name: nginx
ports:
- "80:80"
- "443:443"
environment:
TZ: 'Asia/Shanghai'
volumes:
- ./nginx/ssl:/etc/ssl/private //ssl证书
- ./nginx/conf.d:/etc/nginx/conf.d //配置文件
- ./nginx/html:/usr/share/nginx/html
- ./nginx/log:/var/log/nginx
- ./app:/usr/share/nginx/app/
- ./www:/usr/share/nginx/www/
networks:
haopin_net:
ipv4_address: 172.16.238.21
db:
image: mysql:5.7
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: good!@#007
TZ: 'Asia/Shanghai'
ports:
- "3306:3306"
volumes:
- ./mysql_data:/var/lib/mysql
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./mysql_conf.d:/etc/mysql/conf.d
networks:
haopin_net:
ipv4_address: 172.16.238.31
redis:
image: redis:4.0
container_name: redis
entrypoint:
- redis-server
- /usr/local/etc/redis/redis.conf
volumes:
- ./redis_data:/data
- ./redis_config:/usr/local/etc/redis
ports:
- "6379:6379"
environment:
TZ: 'Asia/Shanghai'
networks:
haopin_net:
ipv4_address: 172.16.238.32
networks:
haopin_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1
docker-compose配置模版
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 1 安装Docker 本机在CentOs7 下安装Docker,其他平台也一样首先查看当前内核版本是否高于 3.1...
- Nginx的docker-compsoe文件 在usr/local/docker/nginx/conf.d/def...
- 1.先在宿主机创建挂载目录:mkdir -p /data/nginx/{conf,conf.d,html,logs...