-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-stack.yml
More file actions
159 lines (150 loc) · 3.69 KB
/
docker-stack.yml
File metadata and controls
159 lines (150 loc) · 3.69 KB
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
155
156
157
158
159
version: '3'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
ports:
- '80:80' # The HTTP port
- '443:443' # The HTTPS port
- '5000:5000' # The Web UI (enabled by --api)
environment:
- DO_AUTH_TOKEN=${DO_AUTH_TOKEN}
networks:
- traefik-net
deploy:
placement:
constraints:
- node.role == manager
volumes:
- ./traefik.toml:/etc/traefik/traefik.toml
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
- /opt/traefik/acme.json:/acme.json
- /opt/traefik/access.log:/access.log
- /opt/traefik/traefik.log:/traefik.log
whoami:
image: containous/whoami # A container that exposes an API to show its IP address
networks:
- traefik-net
deploy:
labels:
- traefik.backend.loadbalancer.swarm=true
- traefik.port=80
- traefik.docker.network=traefik-net
- traefik.frontend.rule=Host:whoami.swarmon.vadee.xyz
api:
image: simonvadee/swarmon-api:${GITHUB_SHA}
networks:
- traefik-net
deploy:
labels:
- traefik.backend.loadbalancer.swarm=true
- traefik.port=8080
- traefik.docker.network=traefik-net
- traefik.frontend.rule=Host:api.swarmon.vadee.xyz
# DATABASE
zero:
image: dgraph/dgraph:latest
volumes:
- db-data:/dgraph
ports:
- 5080
- 6080
networks:
- dgraph
deploy:
labels:
- traefik.enable=false
placement:
constraints:
- node.hostname == leader1
command: dgraph zero --my=zero:5080 --replicas 3
alpha_1:
image: dgraph/dgraph:latest
hostname: 'alpha_1'
volumes:
- db-data:/dgraph
ports:
- 7080
- 8080
- 9080
networks:
- dgraph
- traefik-net
deploy:
labels:
- traefik.backend.loadbalancer.swarm=true
- traefik.port=8080
- traefik.docker.network=traefik-net
- traefik.frontend.rule=Host:db.swarmon.vadee.xyz
placement:
constraints:
- node.hostname == leader1
command: dgraph alpha --my=alpha_1:7080 --lru_mb=2048 --zero=zero:5080
depends_on:
- zero
alpha_2:
image: dgraph/dgraph:latest
hostname: 'alpha_2'
volumes:
- db-data:/dgraph
ports:
- 7081
- 8081
- 9081
networks:
- dgraph
deploy:
labels:
- traefik.enable=false
placement:
constraints:
- node.hostname == docker-swarm-worker-0
command: dgraph alpha --my=alpha_2:7081 --lru_mb=2048 --zero=zero:5080 -o 1
depends_on:
- zero
alpha_3:
image: dgraph/dgraph:latest
hostname: 'alpha_3'
volumes:
- db-data:/dgraph
ports:
- 7082
- 8082
- 9082
networks:
- dgraph
deploy:
labels:
- traefik.enable=false
placement:
constraints:
- node.hostname == docker-swarm-worker-1
command: dgraph alpha --my=alpha_3:7082 --lru_mb=2048 --zero=zero:5080 -o 2
depends_on:
- zero
ratel:
image: dgraph/dgraph:latest
hostname: 'ratel'
ports:
- 8000
networks:
- dgraph
- traefik-net
command: dgraph-ratel
deploy:
labels:
- traefik.backend.loadbalancer.swarm=true
- traefik.port=8000
- traefik.docker.network=traefik-net
- traefik.frontend.rule=Host:db-ui.swarmon.vadee.xyz
- traefik.frontend.auth.digest.users=admin:traefik:a7f9d8497b8ec887429be5792b070d87
placement:
constraints:
- node.hostname == leader1
# NETWORKS
networks:
traefik-net:
external: true
dgraph:
# VOLUMES
volumes:
db-data: