version: '3'
services:
console:
image: harbor1.zlibs.com/i1/console:v1
container_name: i1-console
restart: on-failure:3
environment:
- TZ=Asia/Shanghai
volumes:
- ./config/console/config.json:/opt/sites/i1console/config/config.json
depends_on:
- redis
extra_hosts:
- "i12003priv.solution9.net:172.16.1.6"
networks:
i1-network:
ipv4_address: 172.16.1.7
riki:
image: harbor1.zlibs.com/i1/riki:v1
container_name: i1-riki
restart: on-failure:3
volumes:
- ./logs/riki.log:/var/log/riki.log
- ./config/riki/config.yml:/etc/riki/config.yml
depends_on:
- mysql
- redis
networks:
i1-network:
ipv4_address: 172.16.1.2
sso:
image: harbor1.zlibs.com/i1/sso:v1
container_name: i1-sso
restart: on-failure:3
volumes:
- ./logs/sso.log:/var/log/sso.log
- ./config/sso/config.yml:/opt/sso/config.yml
depends_on:
- mysql
- redis
networks:
i1-network:
ipv4_address: 172.16.1.3
mysql:
image: harbor1.zlibs.com/i1/mysql:v1
container_name: i1-mysql
restart: on-failure:3
environment:
- TZ=Asia/Shanghai
volumes:
- ./data/mysql:/var/lib/mysql
networks:
i1-network:
ipv4_address: 172.16.1.4
redis:
image: harbor1.zlibs.com/cs/redis:5.0
container_name: i1-redis
restart: on-failure:3
volumes:
- ./data/redis:/data
environment:
- TZ=Asia/Shanghai
networks:
i1-network:
ipv4_address: 172.16.1.5
nginx:
image: harbor1.zlibs.com/i1/nginx:v1
container_name: i1-nginx
restart: on-failure:3
environment:
- TZ=Asia/Shanghai
ports:
- "80:80"
volumes:
- ./logs/i1.access.log:/var/log/nginx/i1.access.log
- ./logs/i1.error.log:/var/log/nginx/i1.error.log
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
networks:
i1-network:
ipv4_address: 172.16.1.6
networks:
i1-network:
external: true
# docker network create --gateway 172.16.1.1 --subnet 172.16.1.0/24 i1-network
来源:oschina
链接:https://my.oschina.net/u/4283164/blog/3290534