-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
383 lines (365 loc) · 14.2 KB
/
docker-compose.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
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
name: mender
include:
- path: compose/docker-compose.seaweedfs.yml
services:
create-artifact-worker:
build:
context: .
dockerfile: ./backend/services/create-artifact-worker/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/create-artifact-worker:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
depends_on:
- workflows
environment:
CREATE_ARTIFACT_SKIPVERIFY: "true"
WORKFLOWS_MONGO_URL: "mongodb://mongo"
WORKFLOWS_NATS_URI: "nats://nats"
deployments:
build:
context: .
dockerfile: ./backend/services/deployments/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/deployments:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
depends_on:
mongo:
condition: service_started
s3:
condition: service_healthy
environment:
DEPLOYMENTS_PRESIGN_URL_HOSTNAME: "docker.mender.io"
DEPLOYMENTS_PRESIGN_SECRET: "aW5zZWN1cmUgc2VjcmV0"
DEPLOYMENTS_INVENTORY_ADDR: http://inventory:8080
DEPLOYMENTS_MENDER_WORKFLOWS: http://workflows:8080
DEPLOYMENTS_MONGO_URL: "mongodb://mongo"
DEPLOYMENTS_STORAGE_BUCKET: "mender"
DEPLOYMENTS_AWS_URI: "http://s3:8080"
DEPLOYMENTS_AWS_EXTERNAL_URI: "https://s3.docker.mender.io"
DEPLOYMENTS_AWS_AUTH_KEY: "${MENDER_ACCESS_KEY_ID:-mender}"
DEPLOYMENTS_AWS_AUTH_SECRET: "${MENDER_SECRET_ACCESS_KEY:-thisisnotsecure}"
labels:
traefik.enable: "true"
traefik.http.services.deployments.loadBalancer.server.port: "8080"
traefik.http.routers.deploymentsDL.middlewares: "sec-headers@file,json-error-responder@file"
traefik.http.routers.deploymentsDL.rule: >-
PathRegexp(`/api/devices/v[0-9]+/deployments/download`)
traefik.http.routers.deploymentsDL.service: deployments
traefik.http.routers.deploymentsDev.middlewares: "devStack@file"
traefik.http.routers.deploymentsDev.rule: >-
PathRegexp(`/api/devices/v[0-9]+/deployments`)
traefik.http.routers.deploymentsDev.service: deployments
traefik.http.routers.deploymentsMgmt.middlewares: "mgmtStack@file"
traefik.http.routers.deploymentsMgmt.rule: >-
PathRegexp(`/api/management/v[0-9]+/deployments`)
traefik.http.routers.deploymentsMgmt.service: deployments
networks:
default:
aliases: [mender-deployments]
deviceauth:
build:
context: .
dockerfile: ./backend/services/deviceauth/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/deviceauth:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
depends_on:
- mongo
environment:
DEVICEAUTH_INVENTORY_ADDR: http://inventory:8080
DEVICEAUTH_ORCHESTRATOR_ADDR: http://workflows:8080
DEVICEAUTH_MONGO: "mongodb://mongo"
DEVICEAUTH_SERVER_PRIV_KEY_PATH: "/etc/deviceauth/private.pem"
volumes:
- ./compose/config/mender.pem:/etc/deviceauth/private.pem
labels:
traefik.enable: "true"
traefik.http.services.deviceauth.loadBalancer.server.port: "8080"
traefik.http.routers.deviceauthDev.middlewares: "compression@file"
traefik.http.routers.deviceauthDev.rule: >-
PathRegexp(`/api/devices/v[0-9]+/authentication`)
traefik.http.routers.deviceauthDev.service: deviceauth
traefik.http.routers.deviceauthMgmt.middlewares: "mgmtStack@file"
traefik.http.routers.deviceauthMgmt.rule: >-
PathRegexp(`/api/management/v[0-9]+/devauth`)
traefik.http.routers.deviceauthMgmt.service: deviceauth
networks:
default:
aliases: [mender-deviceauth]
deviceconfig:
build:
context: .
dockerfile: ./backend/services/deviceconfig/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/deviceconfig:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
environment:
DEVICECONFIG_INVENTORY_URI: http://inventory:8080
DEVICECONFIG_WORKFLOWS_URL: http://workflows:8080
DEVICECONFIG_MONGO_URL: "mongodb://mongo"
depends_on:
- mongo
labels:
traefik.enable: "true"
traefik.http.services.deviceconfig.loadBalancer.server.port: "8080"
traefik.http.routers.deviceconfigDev.middlewares: "devStack@file"
traefik.http.routers.deviceconfigDev.rule: >-
PathRegexp(`/api/devices/v[0-9]+/deviceconfig`)
traefik.http.routers.deviceconfigDev.service: deviceconfig
traefik.http.routers.deviceconfigMgmt.middlewares: "mgmtStack@file"
traefik.http.routers.deviceconfigMgmt.rule: >-
PathRegexp(`/api/management/v[0-9]+/deviceconfig`)
traefik.http.routers.deviceconfigMgmt.service: deviceconfig
networks:
default:
aliases: [mender-deviceconfig]
deviceconnect:
build:
context: .
dockerfile: ./backend/services/deviceconnect/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/deviceconnect:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
depends_on:
- mongo
- nats
environment:
DEVICECONNECT_INVENTORY_URI: http://inventory:8080
DEVICECONNECT_WORKFLOWS_URL: http://workflows:8080
DEVICECONNECT_MONGO_URL: "mongodb://mongo"
DEVICECONNECT_NATS_URL: "mongodb://mongo"
labels:
traefik.enable: "true"
traefik.http.services.deviceconnect.loadBalancer.server.port: "8080"
traefik.http.routers.deviceconnectDev.middlewares: "devStack@file"
traefik.http.routers.deviceconnectDev.rule: >-
PathRegexp(`/api/devices/v[0-9]+/deviceconnect`)
traefik.http.routers.deviceconnectDev.service: deviceconnect
traefik.http.routers.deviceconnectMgmt.middlewares: "mgmtStack@file"
traefik.http.routers.deviceconnectMgmt.rule: >-
PathRegexp(`/api/management/v[0-9]+/deviceconnect`)
traefik.http.routers.deviceconnectMgmt.service: deviceconnect
networks:
default:
aliases: [mender-deviceconnect]
gui:
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/gui:${MENDER_IMAGE_TAG:-latest}
build:
context: ./frontend
restart: on-failure:3
labels:
traefik.enable: "true"
traefik.http.services.gui.loadBalancer.server.port: "8090"
traefik.http.services.error-responder.loadBalancer.server.port: "8080"
traefik.http.routers.gui.middlewares: >-
compression@file,sec-headers@file,json-error-responder@file
traefik.http.routers.gui.priority: 1
traefik.http.routers.gui.rule: PathPrefix(`/`)
traefik.http.routers.gui.service: gui
environment:
HAVE_AUDITLOGS: "0"
HAVE_DELTA_PROGRESS: "0"
HAVE_DEVICECONFIG: "1"
HAVE_DEVICECONNECT: "1"
HAVE_ENTERPRISE: "0"
HAVE_MONITOR: "0"
HAVE_MULTITENANT: "0"
networks:
default:
aliases: [mender-gui]
inventory:
build:
context: .
dockerfile: ./backend/services/inventory/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/inventory:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
depends_on:
- mongo
environment:
INVENTORY_DEVICEMONITOR_ADDR: http://devicemonitor:8080
INVENTORY_ORCHESTRATOR_ADDR: http://workflows:8080
INVENTORY_MONGO: mongodb://mongo
INVENTORY_NATS_URI: "nats://nats"
labels:
traefik.enable: "true"
traefik.http.services.inventory.loadBalancer.server.port: "8080"
traefik.http.routers.inventoryDevV1.middlewares: >-
devStack@file,inventoryV1-replacepathregex@file
traefik.http.routers.inventoryDevV1.rule: >-
PathRegexp(`/api/devices/v1/inventory`)
traefik.http.routers.inventoryDevV1.service: inventory
traefik.http.routers.inventoryMgmtV1.middlewares: >-
mgmtStack@file,inventoryMgmtV1-replacepathregex@file
traefik.http.routers.inventoryMgmtV1.rule: >-
PathRegexp(`/api/management/v1/inventory`)
traefik.http.routers.inventoryMgmtV1.service: inventory
traefik.http.routers.inventoryDev.middlewares: "devStack@file"
traefik.http.routers.inventoryDev.rule: >-
PathRegexp(`/api/devices/v[2-9]/inventory`)
traefik.http.routers.inventoryDev.service: inventory
traefik.http.routers.inventoryMgmt.middlewares: "mgmtStack@file"
traefik.http.routers.inventoryMgmt.rule: >-
PathRegexp(`/api/management/v[2-9]/inventory`)
traefik.http.routers.inventoryMgmt.service: inventory
networks:
default:
aliases: [mender-inventory]
iot-manager:
build:
context: .
dockerfile: ./backend/services/iot-manager/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/iot-manager:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
depends_on:
- mongo
environment:
IOT_MANAGER_DEVICEAUTH_URL: "http://deviceauth:8080"
IOT_MANAGER_WORKFLOWS_URL: "http://workflows:8080"
IOT_MANAGER_MONGO_URL: "mongodb://mongo"
IOT_MANAGER_NATS_URI: "nats://nats"
labels:
traefik.enable: "true"
traefik.http.services.iot-manager.loadBalancer.server.port: "8080"
traefik.http.routers.iot-managerMgmt.middlewares: "mgmtStack@file"
traefik.http.routers.iot-managerMgmt.rule: >-
PathRegexp(`/api/management/v[0-9]+/iot-manager`)
traefik.http.routers.iot-managerMgmt.service: iot-manager
networks:
default:
aliases: [mender-iot-manager]
useradm:
build:
context: .
dockerfile: ./backend/services/useradm/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/useradm:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
depends_on:
- mongo
environment:
USERADM_MONGO: "mongodb://mongo"
USERADM_SERVER_PRIV_KEY_PATH: "/etc/useradm/private.pem"
labels:
traefik.enable: "true"
traefik.http.services.useradm.loadBalancer.server.port: "8080"
traefik.http.routers.useradm.middlewares: "mgmtStack@file"
traefik.http.routers.useradm.rule: >-
PathRegexp(`/api/management/v[0-9]+/useradm`)
traefik.http.routers.useradm.service: useradm
traefik.http.routers.userauth.middlewares: >-
compression@file,sec-headers@file,json-error-responder@file
traefik.http.routers.userauth.rule: >-
!PathRegexp(`/api/management/v[0-9]+/useradm/auth/logout`) &&
PathRegexp(`/api/management/v[0-9]+/useradm/(auth|oauth2|oidc)`)
traefik.http.routers.userauth.service: useradm
networks:
default:
aliases: [mender-useradm]
volumes:
- ./compose/config/mender.pem:/etc/useradm/private.pem
workflows-worker:
build:
context: .
dockerfile: ./backend/services/workflows/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/workflows:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: ["worker"]
depends_on:
- workflows
environment:
WORKFLOWS_MONGO_URL: "mongodb://mongo"
WORKFLOWS_NATS_URI: "nats://nats"
DEPLOYMENTS_ADDR: deployments:8080
DEVICEAUTH_ADDR: deviceauth:8080
DEVICECONFIG_ADDR: deviceconfig:8080
DEVICECONNECT_ADDR: deviceconnect:8080
INVENTORY_ADDR: inventory:8080
IOT_MANAGER_ADDR: iot-manager:8080
USERADM_ADDR: useradm:8080
WORKFLOWS_SERVER_ADDR: workflows:8080
WOKRFLOWS_MENDER_URL: https://docker.mender.io
HAVE_DEVICECONFIG: "1"
workflows:
build:
context: .
dockerfile: ./backend/services/workflows/Dockerfile
image: ${MENDER_IMAGE_REGISTRY:-docker.io}/${MENDER_IMAGE_REPOSITORY:-mendersoftware}/workflows:${MENDER_IMAGE_TAG:-latest}
restart: on-failure:3
command: [server, --automigrate]
depends_on:
- mongo
- nats
environment:
WORKFLOWS_MONGO_URL: "mongodb://mongo"
WORKFLOWS_NATS_URI: "nats://nats"
networks:
default:
aliases: [mender-workflows]
traefik:
image: traefik:v3.1
command:
- --api=true
- --api.insecure=true
- --accesslog=true
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.websecure.address=:443
- --entrypoints.websecure.transport.respondingTimeouts.idleTimeout=7200
- --entrypoints.websecure.transport.respondingTimeouts.readTimeout=7200
- --entrypoints.websecure.transport.respondingTimeouts.writeTimeout=7200
- --entrypoints.websecure.http.tls=true
- --entrypoints.websecure.asDefault=true
- --providers.file.directory=/etc/traefik/config
- --providers.docker=true
- --providers.docker.exposedByDefault=false
volumes:
- ./compose/config/traefik:/etc/traefik/config:ro
- ./compose/certs:/etc/traefik/certs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 443:443
- 80:80
networks:
default:
aliases:
- s3.localhost
- mender.local
- s3.mender.local
- docker.mender.io
- s3.docker.mender.io
mongo:
image: mongo:6.0
volumes:
- mongo:/data/db
networks:
default:
aliases: [mender-mongo]
nats:
image: nats:2.10
command: [-js]
networks:
default:
aliases: [mender-nats]
client:
image: mendersoftware/mender-client-docker-addons:mender-master
scale: 0
configs:
- source: client_json
target: /etc/mender/mender.conf
volumes:
- ./compose/certs/mender.crt:/var/lib/mender/mender.crt
configs:
client_json:
content: |
{
"InventoryPollIntervalSeconds": 5,
"RetryPollIntervalSeconds": 5,
"ServerURL": "${SERVER_URL:-https://docker.mender.io}",
"ServerCertificate": "/var/lib/mender/mender.crt",
"UpdatePollIntervalSeconds": 5,
"TenantToken": "${TENANT_TOKEN:-}"
}
volumes:
mongo: {}