-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
58 lines (55 loc) · 1.38 KB
/
docker-compose.yaml
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
# Assignment Requirements
# db must only run on a node with ssd=true label
# vote should be HA with 2 replicas
# vote must not run on Swarm manager nodes
# worker needs to scale with Swarm worker nodes, 1 task each
version: "3.1"
services:
redis:
image: redis:alpine
networks:
- frontend
db:
image: postgres:9.6
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
networks:
- backend
deploy:
placement:
constraints:
- node.labels.ssd == true
vote:
image: bretfisher/examplevotingapp_vote
ports:
- '5000:80'
networks:
- frontend
deploy:
replicas: 2
placement:
constraints:
- node.role == worker
result:
image: bretfisher/examplevotingapp_result
ports:
- '5001:80'
networks:
- backend
worker:
image: bretfisher/examplevotingapp_worker:java
networks:
- frontend
- backend
deploy:
mode: global
placement:
constraints:
- node.role == worker
networks:
frontend: null
backend: null
volumes:
db-data: null