-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-stack.yml
95 lines (86 loc) · 1.91 KB
/
docker-stack.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
version: "3.5"
services:
app:
image: saket7/cs2304_api
command: npm run start
deploy:
replicas: 2
restart_policy:
condition: on-failure
placement:
constraints: [node.role == worker]
labels:
- "traefik.backend= app"
- "traefik.frontend.rule=PathPrefixStrip:/api"
- "traefik.port=3000"
- "traefik.enable=true"
working_dir: /app
networks:
- webnet
reverse-proxy:
image: traefik
read_only: true
command: --api --docker --docker.swarmMode
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == manager]
ports:
- "80:80"
- "8080:8080"
networks:
- webnet
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# So that Traefik can listen to the Docker events
client:
image: vtcs2304s19/blabber-client
networks:
- webnet
deploy:
replicas: 2
restart_policy:
condition: on-failure
placement:
constraints: [node.role == worker]
labels:
- "traefik.backend= client"
- "traefik.frontend.rule=/"
- "traefik.port=80"
- "traefik.enable=true"
tests:
image: vtcs2304s19/blabber-api-tests
environment:
SERVICE_NAME: app
API_PORT: "3000"
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == worker]
networks:
- webnet
mongo:
image: mongo
networks:
- webnet
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == worker]
volumes:
- mongo-data:/data/db
secrets:
-my_secret
volumes:
mongo-data:
networks:
webnet:
secrets:
my_secret:
file: ./mysecret.txt