Skip to content

Commit 006f294

Browse files
author
Mano Marks
authored
Merge pull request dockersamples#58 from ManoMarks/stack
Adding in docker-stack.yml
2 parents 0334f60 + d53ab16 commit 006f294

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

docker-stack.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
version: "3"
2+
services:
3+
4+
redis:
5+
image: redis:alpine
6+
ports:
7+
- "6379"
8+
networks:
9+
- frontend
10+
deploy:
11+
replicas: 2
12+
update_config:
13+
parallelism: 2
14+
delay: 10s
15+
restart_policy:
16+
condition: on-failure
17+
db:
18+
image: postgres:9.4
19+
volumes:
20+
- db-data:/var/lib/postgresql/data
21+
networks:
22+
- backend
23+
deploy:
24+
placement:
25+
constraints: [node.role == manager]
26+
vote:
27+
image: dockersamples/examplevotingapp_vote:before
28+
ports:
29+
- 5000:80
30+
networks:
31+
- frontend
32+
depends_on:
33+
- redis
34+
deploy:
35+
replicas: 2
36+
update_config:
37+
parallelism: 2
38+
restart_policy:
39+
condition: on-failure
40+
result:
41+
image: dockersamples/examplevotingapp_result:before
42+
ports:
43+
- 5001:80
44+
networks:
45+
- backend
46+
depends_on:
47+
- db
48+
deploy:
49+
replicas: 2
50+
update_config:
51+
parallelism: 2
52+
delay: 10s
53+
restart_policy:
54+
condition: on-failure
55+
56+
worker:
57+
image: dockersamples/examplevotingapp_worker
58+
networks:
59+
- frontend
60+
- backend
61+
deploy:
62+
mode: replicated
63+
replicas: 1
64+
labels: [APP=VOTING]
65+
restart_policy:
66+
condition: on-failure
67+
delay: 10s
68+
max_attempts: 3
69+
window: 120s
70+
placement:
71+
constraints: [node.role == manager]
72+
73+
visualizer:
74+
image: dockersamples/visualizer:stable
75+
ports:
76+
- "8080:8080"
77+
stop_grace_period: 1m30s
78+
volumes:
79+
- "/var/run/docker.sock:/var/run/docker.sock"
80+
81+
networks:
82+
frontend:
83+
backend:
84+
85+
volumes:
86+
db-data:

0 commit comments

Comments
 (0)