-
Notifications
You must be signed in to change notification settings - Fork 7
/
compose_all_the_things.yml
154 lines (143 loc) · 3.25 KB
/
compose_all_the_things.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: "3.4"
x-updating:
¶llel
parallelism: 2
delay: 10s
order: start-first
failure_action: rollback
services:
app:
image: clemenko/flask_demo
security_opt:
- no-new-privileges:true
deploy:
replicas: 4
resources:
limits:
cpus: '0.5'
memory: 50M
reservations:
cpus: '0.5'
memory: 50M
update_config: *parallel
mode: replicated
placement:
constraints:
- 'node.role == worker'
- 'node.platform.os == linux'
# preferences:
# - spread: node.labels.availabilityZone
labels:
com.docker.ucp.access.label: "/prod"
com.docker.lb.network: flask_kv
com.docker.lb.hosts: app.dockr.life
# com.docker.lb.sticky_session_cookie: session
com.docker.lb.context_root: /
# com.docker.lb.context_root_rewrite: true
com.docker.lb.port: 5000
ports:
- 5000:5000
networks:
db:
kv:
secrets:
- source: demo_title_v1
target: demo_title
mongo:
image: mongo
security_opt:
- no-new-privileges:true
deploy:
labels:
com.docker.ucp.access.label: "/prod"
placement:
constraints:
- 'node.role == worker'
networks:
db:
redis:
image: redis:alpine
security_opt:
- no-new-privileges:true
deploy:
labels:
com.docker.ucp.access.label: "/prod"
placement:
constraints:
- 'node.role == worker'
networks:
kv:
cockroach_master:
image: cockroachdb/cockroach:v19.1.4
security_opt:
- no-new-privileges:true
deploy:
labels:
com.docker.ucp.access.label: "/prod"
com.docker.lb.hosts: roach.dockr.life
com.docker.lb.port: 8080
placement:
constraints:
- 'node.role == worker'
ports:
- 8090:8080
command: start --insecure
networks:
db:
cockroach_slave:
image: cockroachdb/cockroach:v19.1.4
security_opt:
- no-new-privileges:true
deploy:
labels:
com.docker.ucp.access.label: "/prod"
replicas: 4
placement:
constraints:
- 'node.role == worker'
command: start --insecure --join=cockroach_master
networks:
db:
whoami:
image: containous/whoami
security_opt:
- no-new-privileges:true
deploy:
replicas: 2
mode: replicated
labels:
com.docker.lb.hosts: whoami.dockr.life
# com.docker.lb.context_root: /whoami/
com.docker.lb.port: 80
placement:
constraints:
- 'node.role == worker'
visualizer:
image: mikesir87/swarm-viz
security_opt:
- no-new-privileges:true
deploy:
placement:
constraints:
- 'node.role == manager'
labels:
com.docker.lb.hosts: viz.dockr.life
com.docker.lb.port: 3000
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 3030:3000
networks:
kv:
labels:
com.docker.ucp.access.label: "/prod"
db:
labels:
com.docker.ucp.access.label: "/prod"
driver: overlay
driver_opts:
encrypted: ""
secrets:
demo_title_v1:
external: true
#configs: