39 lines
797 B
YAML
39 lines
797 B
YAML
version: '3.8'
|
|
|
|
# 可以使用 scale 动态扩容容器:docker-compose scale app-name=3
|
|
|
|
services:
|
|
app1-name:
|
|
image: 'colovu/app1-name:latest'
|
|
restart: always
|
|
ports:
|
|
- '8000:8000'
|
|
environment:
|
|
- ALLOW_ANONYMOUS_LOGIN=yes
|
|
|
|
app2-name:
|
|
image: 'colovu/app2-name:latest'
|
|
ports:
|
|
- '8080'
|
|
environment:
|
|
- ALLOW_ANONYMOUS_LOGIN=yes
|
|
volumes:
|
|
- 'app_conf:/srv/conf'
|
|
depends_on:
|
|
- app1-name
|
|
|
|
# 系统中已经存在使用`docker network create front-tier --driver bridge`创建的网络
|
|
networks:
|
|
back-tier:
|
|
external: back-tier
|
|
front-tier:
|
|
driver: bridge
|
|
|
|
# 定义本地数据卷,由系统管理,需要手动删除
|
|
volumes:
|
|
app_conf:
|
|
driver: local
|
|
app_data:
|
|
driver: local
|
|
app_datalog:
|
|
driver: local |