-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathdocker-compose-deploy-v3.yml
75 lines (72 loc) · 1.94 KB
/
docker-compose-deploy-v3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "3.3"
services:
app:
image: ${DTR_URL:-msr.mirantis.work.mbentley.net}/demo/docker-demo:${TAG:-latest}
deploy:
mode: replicated
replicas: 4
update_config:
parallelism: 2
delay: 5s
failure_action: continue
labels:
- "com.docker.ucp.access.label=/demo-collection/${ENVIRONMENT:-dev}"
- "com.docker.lb.hosts=docker-demo-${ENVIRONMENT:-dev}.${DOMAIN_NAME:-mirantis.work.mbentley.net}"
- "com.docker.lb.port=8080"
- "com.docker.lb.network=docker-demo-${ENVIRONMENT:-dev}_docker-demo"
environment:
- "TITLE=Docker Demo-${ENVIRONMENT:-dev} on Swarm mode"
- "DB_HOST=db"
- "DB_PORT=5432"
- "DB_NAME=${DB_NAME:-demo}"
- "DB_SSL_MODE=disable"
secrets:
- source: DB_USER
target: DB_USER
uid: "0"
gid: "0"
mode: 0400
- source: DB_PASS
target: DB_PASS
uid: "0"
gid: "0"
mode: 0400
networks:
- docker-demo
db:
image: ${DTR_URL:-msr.mirantis.work.mbentley.net}/official/postgres:latest
deploy:
mode: replicated
replicas: 1
labels:
- "com.docker.ucp.access.label=/demo-collection/${ENVIRONMENT:-dev}"
environment:
- "POSTGRES_USER_FILE=/run/secrets/DB_USER"
- "POSTGRES_PASSWORD_FILE=/run/secrets/DB_PASS"
secrets:
- source: DB_USER
target: DB_USER
uid: "999"
gid: "999"
mode: 0400
- source: DB_PASS
target: DB_PASS
uid: "999"
gid: "999"
mode: 0400
volumes:
- /shared/postgres/swarm/${ENVIRONMENT:-dev}:/var/lib/postgresql/data
networks:
- docker-demo
networks:
docker-demo:
driver: overlay
labels:
- "com.docker.ucp.access.label=/demo-collection/${ENVIRONMENT:-dev}"
secrets:
DB_USER:
external:
name: ${ENVIRONMENT:-dev}_DB_USER
DB_PASS:
external:
name: ${ENVIRONMENT:-dev}_DB_PASS