-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
407 lines (403 loc) · 10.8 KB
/
docker-compose.yml
File metadata and controls
407 lines (403 loc) · 10.8 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
version: '3.5'
services:
server:
build: server/
ports:
- '${SERVER_PORT}:${SERVER_PORT}'
- '${CLUSTER_MANAGER_PORT}:${CLUSTER_MANAGER_PORT}'
- '${CLUSTER_NODE_PORT}:${CLUSTER_NODE_PORT}'
- '${CLUSTER_NODE_PORT}:${CLUSTER_NODE_PORT}/udp'
- '${CLUSTER_NETWORK_PORT}:${CLUSTER_NETWORK_PORT}/udp'
- '${TASK_QUEUE_PORT}:${TASK_QUEUE_PORT}'
environment:
- SERVER_PORT
- API_DOMAIN
- API_HOSTNAME
- API_PORT
- CLUSTER_HOSTNAME
- CLUSTER_MANAGER_PORT
- CLUSTER_NODE_PORT
- CLUSTER_NETWORK_PORT
- REGISTRY_DOMAIN
- REGISTRY_HOSTNAME
- REGISTRY_PORT
- CONSOLE_DOMAIN
- CONSOLE_HOSTNAME
- CONSOLE_PORT
- STORAGE_DOMAIN
- STORAGE_HOSTNAME
- STORAGE_PORT
- TASK_QUEUE_HOSTNAME
- TASK_QUEUE_PORT
networks:
- renderable
depends_on:
- api
restart: unless-stopped
api:
build: api/
expose:
- '${API_PORT}'
environment:
- API_DOMAIN
- API_VERSION
- API_PRODUCTION
- API_WORKERS
- API_WEBSOCKET_TIMEOUT
- API_WEBSOCKET_HEARTBEAT_PERIOD
- API_MAXIMUM_TASK_RETRIES
- API_PORT
- CLUSTER_DOMAIN_IP
- CLUSTER_HOSTNAME
- CLUSTER_PORT
- CLUSTER_MANAGER_PORT
- CLUSTER_CERTIFICATE_PATH=/etc/ssl/certs/cluster/
- REGISTRY_DOMAIN
- DATABASE_HOSTNAME
- DATABASE_PORT
- STORAGE_DOMAIN
- STORAGE_HOSTNAME
- STORAGE_PORT
- CONTAINER_QUEUE_HOSTNAME
- CONTAINER_QUEUE_PORT
- TASK_QUEUE_DOMAIN
- TASK_QUEUE_HOSTNAME
- TASK_QUEUE_PORT
- RESOURCE_QUEUE_HOSTNAME
- RESOURCE_QUEUE_PORT
- STATE_QUEUE_HOSTNAME
- STATE_QUEUE_PORT
secrets:
- api_access_key
- registry_username
- registry_password
- database_username
- database_password
- storage_access_key
- storage_secret_key
- container_queue_username
- container_queue_password
- task_queue_username
- task_queue_password
- resource_queue_username
- resource_queue_password
- state_queue_username
- state_queue_password
volumes:
- cluster_certificate:/etc/ssl/certs/cluster/
networks:
renderable:
aliases:
- ${API_HOSTNAME}
depends_on:
- cluster
- database
- storage
- container_queue
- task_queue
- resource_queue
- state_queue
restart: unless-stopped
autoscaler:
build: autoscaler/
environment:
- CLUSTER_CLEANUP_PERIOD
- CLUSTER_COOLDOWN_PERIOD
- CLUSTER_HOSTNAME
- CLUSTER_PORT
- CLUSTER_CERTIFICATE_PATH=/etc/ssl/certs/cluster/
- CONTAINER_QUEUE_HOSTNAME
- CONTAINER_QUEUE_PORT
secrets:
- container_queue_username
- container_queue_password
volumes:
- cluster_certificate:/etc/ssl/certs/cluster/
networks:
- renderable
depends_on:
- cluster
- container_queue
restart: unless-stopped
compressor:
build: compressor/
environment:
- API_PRODUCTION
- DATABASE_HOSTNAME
- DATABASE_PORT
- STORAGE_DOMAIN
- STORAGE_HOSTNAME
- STORAGE_PORT
- RESOURCE_QUEUE_HOSTNAME
- RESOURCE_QUEUE_PORT
- STATE_QUEUE_HOSTNAME
- STATE_QUEUE_PORT
secrets:
- database_username
- database_password
- storage_access_key
- storage_secret_key
- resource_queue_username
- resource_queue_password
- state_queue_username
- state_queue_password
networks:
- renderable
depends_on:
- database
- storage
- resource_queue
- state_queue
restart: unless-stopped
cluster:
image: docker:19.03.12-dind
hostname: ${CLUSTER_HOSTNAME}
expose:
- '${CLUSTER_PORT}'
- '${CLUSTER_MANAGER_PORT}'
- '${CLUSTER_NODE_PORT}'
- '${CLUSTER_NODE_PORT}/udp'
- '${CLUSTER_NETWORK_PORT}/udp'
privileged: true
volumes:
- cluster:/var/lib/docker/
- cluster_certificate:/certs/client/
networks:
renderable:
aliases:
- ${CLUSTER_HOSTNAME}
command: '--insecure-registry=${CLUSTER_INSECURE_REGISTRY}'
depends_on:
- registry
restart: unless-stopped
registry:
image: registry:2.7
expose:
- '${REGISTRY_PORT}'
environment:
- REGISTRY_HTTP_ADDR=:${REGISTRY_PORT}
- REGISTRY_HTTP_SECRET_FILE=/run/secrets/registry_secret_key
- REGISTRY_AUTH=htpasswd
- REGISTRY_AUTH_HTPASSWD_REALM='Renderable Registry'
- REGISTRY_AUTH_HTPASSWD_PATH=/run/secrets/registry_encrypted_password
- REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR=redis
- REGISTRY_REDIS_ADDR=${CACHE_HOSTNAME}:${CACHE_PORT}
- REGISTRY_REDIS_PASSWORD_FILE=/run/secrets/cache_password
secrets:
- registry_encrypted_password
- registry_secret_key
- cache_password
volumes:
- registry:/var/lib/registry/
networks:
renderable:
aliases:
- ${REGISTRY_HOSTNAME}
command: '/bin/sh -c \
"REGISTRY_HTTP_SECRET=\"$$(cat $$REGISTRY_HTTP_SECRET_FILE)\"
REGISTRY_REDIS_PASSWORD=\"$$(cat $$REGISTRY_REDIS_PASSWORD_FILE)\"
registry serve /etc/docker/registry/config.yml"'
depends_on:
- cache
restart: unless-stopped
console:
image: portainer/portainer:1.24.1-alpine
expose:
- '${CONSOLE_PORT}'
environment:
- PORTAINER_PASSWORD_FILE=/run/secrets/console_encrypted_password
secrets:
- console_encrypted_password
volumes:
- console:/data/
- cluster_certificate:/certs/
networks:
renderable:
aliases:
- ${CONSOLE_HOSTNAME}
entrypoint: ''
command: '/bin/sh -c \
"./portainer -H tcp://${CLUSTER_HOSTNAME}:${CLUSTER_PORT} --tlsverify --admin-password \"$$(cat $$PORTAINER_PASSWORD_FILE)\""'
depends_on:
- cluster
restart: unless-stopped
cache:
image: redis:6.0.5
expose:
- '${CACHE_PORT}'
environment:
- REDIS_PASSWORD_FILE=/run/secrets/cache_password
secrets:
- cache_password
volumes:
- cache:/data/
networks:
renderable:
aliases:
- ${CACHE_HOSTNAME}
command: '/bin/bash -c \
"redis-server --port ${CACHE_PORT} --requirepass \"$$(cat $$REDIS_PASSWORD_FILE)\""'
restart: unless-stopped
database:
image: mongo:4.2.6
expose:
- '${DATABASE_PORT}'
environment:
- MONGO_INITDB_DATABASE=db
- MONGO_INITDB_ROOT_USERNAME_FILE=/run/secrets/database_username
- MONGO_INITDB_ROOT_PASSWORD_FILE=/run/secrets/database_password
secrets:
- database_username
- database_password
volumes:
- database:/data/db/
networks:
renderable:
aliases:
- ${DATABASE_HOSTNAME}
command: 'mongod --port ${DATABASE_PORT}'
restart: unless-stopped
storage:
image: minio/minio:RELEASE.2020-05-16T01-33-21Z
expose:
- '${STORAGE_PORT}'
environment:
- MINIO_ACCESS_KEY_FILE=storage_access_key
- MINIO_SECRET_KEY_FILE=storage_secret_key
- MINIO_BROWSER=on
secrets:
- storage_access_key
- storage_secret_key
volumes:
- storage:/data/
networks:
renderable:
aliases:
- ${STORAGE_HOSTNAME}
command: 'minio server --address :${STORAGE_PORT} /data/'
restart: unless-stopped
container_queue:
image: rabbitmq:3.8-management
expose:
- '${CONTAINER_QUEUE_PORT}'
environment:
- RABBITMQ_NODE_PORT=${CONTAINER_QUEUE_PORT}
- RABBITMQ_DEFAULT_USER_FILE=/run/secrets/container_queue_username
- RABBITMQ_DEFAULT_PASS_FILE=/run/secrets/container_queue_password
secrets:
- container_queue_username
- container_queue_password
volumes:
- container_queue:/data/
networks:
renderable:
aliases:
- ${CONTAINER_QUEUE_HOSTNAME}
restart: unless-stopped
task_queue:
image: rabbitmq:3.8-management
expose:
- '${TASK_QUEUE_PORT}'
environment:
- RABBITMQ_NODE_PORT=${TASK_QUEUE_PORT}
- RABBITMQ_DEFAULT_USER_FILE=/run/secrets/task_queue_username
- RABBITMQ_DEFAULT_PASS_FILE=/run/secrets/task_queue_password
secrets:
- task_queue_username
- task_queue_password
volumes:
- task_queue:/data/
networks:
renderable:
aliases:
- ${TASK_QUEUE_HOSTNAME}
restart: unless-stopped
resource_queue:
image: rabbitmq:3.8-management
expose:
- '${RESOURCE_QUEUE_PORT}'
environment:
- RABBITMQ_NODE_PORT=${RESOURCE_QUEUE_PORT}
- RABBITMQ_DEFAULT_USER_FILE=/run/secrets/resource_queue_username
- RABBITMQ_DEFAULT_PASS_FILE=/run/secrets/resource_queue_password
secrets:
- resource_queue_username
- resource_queue_password
volumes:
- resource_queue:/data/
networks:
renderable:
aliases:
- ${RESOURCE_QUEUE_HOSTNAME}
restart: unless-stopped
state_queue:
image: rabbitmq:3.8-management
expose:
- '${STATE_QUEUE_PORT}'
environment:
- RABBITMQ_NODE_PORT=${STATE_QUEUE_PORT}
- RABBITMQ_DEFAULT_USER_FILE=/run/secrets/state_queue_username
- RABBITMQ_DEFAULT_PASS_FILE=/run/secrets/state_queue_password
secrets:
- state_queue_username
- state_queue_password
volumes:
- state_queue:/data/
networks:
renderable:
aliases:
- ${STATE_QUEUE_HOSTNAME}
restart: unless-stopped
secrets:
api_access_key:
file: secrets/api_access_key
registry_username:
file: secrets/registry_username
registry_password:
file: secrets/registry_password
registry_encrypted_password:
file: secrets/registry_encrypted_password
registry_secret_key:
file: secrets/registry_secret_key
console_encrypted_password:
file: secrets/console_encrypted_password
cache_password:
file: secrets/cache_password
database_username:
file: secrets/database_username
database_password:
file: secrets/database_password
storage_access_key:
file: secrets/storage_access_key
storage_secret_key:
file: secrets/storage_secret_key
container_queue_username:
file: secrets/container_queue_username
container_queue_password:
file: secrets/container_queue_password
task_queue_username:
file: secrets/task_queue_username
task_queue_password:
file: secrets/task_queue_password
resource_queue_username:
file: secrets/resource_queue_username
resource_queue_password:
file: secrets/resource_queue_password
state_queue_username:
file: secrets/state_queue_username
state_queue_password:
file: secrets/state_queue_password
volumes:
cluster:
cluster_certificate:
registry:
console:
cache:
database:
storage:
container_queue:
task_queue:
resource_queue:
state_queue:
networks:
renderable: