-
Notifications
You must be signed in to change notification settings - Fork 50
/
docker-compose.yml
297 lines (280 loc) · 10.4 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
services:
astarte-housekeeping:
image: astarte/astarte_housekeeping:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_housekeeping
env_file:
- ./compose.env
restart: on-failure
depends_on:
- "rabbitmq"
- "scylla"
astarte-housekeeping-api:
image: astarte/astarte_housekeeping_api:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_housekeeping_api
env_file:
- ./compose.env
environment:
HOUSEKEEPING_API_JWT_PUBLIC_KEY_PATH: "/keys/housekeeping_public.pem"
volumes:
- type: bind
source: ./compose/astarte-keys/housekeeping_public.pem
target: /keys/housekeeping_public.pem
restart: on-failure
depends_on:
- "rabbitmq"
- "traefik"
labels:
- "traefik.enable=true"
- "traefik.http.routers.astarte-housekeeping-api.rule=Host(`api.astarte.localhost`)"
- "traefik.http.routers.astarte-housekeeping-api.rule=PathPrefix(`/housekeeping`)"
- "traefik.http.routers.astarte-housekeeping-api.entrypoints=web"
- "traefik.http.routers.astarte-housekeeping-api.middlewares=astarte-housekeeping-api"
- "traefik.http.routers.astarte-housekeeping-api.service=astarte-housekeeping-api"
- "traefik.http.middlewares.astarte-housekeeping-api.stripprefix.prefixes=/housekeeping"
- "traefik.http.middlewares.astarte-housekeeping-api.stripprefix.forceSlash=false"
- "traefik.http.services.astarte-housekeeping-api.loadbalancer.server.port=4001"
astarte-realm-management:
image: astarte/astarte_realm_management:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_realm_management
env_file:
- ./compose.env
restart: on-failure
depends_on:
- "rabbitmq"
- "scylla"
astarte-realm-management-api:
image: astarte/astarte_realm_management_api:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_realm_management_api
env_file:
- ./compose.env
restart: on-failure
depends_on:
- "rabbitmq"
- "traefik"
labels:
- "traefik.enable=true"
- "traefik.http.routers.astarte-realm-management-api.rule=Host(`api.astarte.localhost`)"
- "traefik.http.routers.astarte-realm-management-api.rule=PathPrefix(`/realmmanagement`)"
- "traefik.http.routers.astarte-realm-management-api.entrypoints=web"
- "traefik.http.routers.astarte-realm-management-api.middlewares=astarte-realm-management-api"
- "traefik.http.routers.astarte-realm-management-api.service=astarte-realm-management-api"
- "traefik.http.middlewares.astarte-realm-management-api.stripprefix.prefixes=/realmmanagement"
- "traefik.http.middlewares.astarte-realm-management-api.stripprefix.forceSlash=false"
- "traefik.http.services.astarte-realm-management-api.loadbalancer.server.port=4000"
astarte-pairing:
image: astarte/astarte_pairing:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_pairing
env_file:
- ./compose.env
environment:
PAIRING_CFSSL_URL: "http://cfssl:8080"
restart: on-failure
depends_on:
- "rabbitmq"
- "scylla"
astarte-pairing-api:
image: astarte/astarte_pairing_api:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_pairing_api
env_file:
- ./compose.env
restart: on-failure
depends_on:
- "rabbitmq"
- "traefik"
labels:
- "traefik.enable=true"
- "traefik.http.routers.astarte-pairing-api.rule=Host(`api.astarte.localhost`)"
- "traefik.http.routers.astarte-pairing-api.rule=PathPrefix(`/pairing`)"
- "traefik.http.routers.astarte-pairing-api.entrypoints=web"
- "traefik.http.routers.astarte-pairing-api.middlewares=astarte-pairing-api"
- "traefik.http.routers.astarte-pairing-api.service=astarte-pairing-api"
- "traefik.http.middlewares.astarte-pairing-api.stripprefix.prefixes=/pairing"
- "traefik.http.middlewares.astarte-pairing-api.stripprefix.forceSlash=false"
- "traefik.http.services.astarte-pairing-api.loadbalancer.server.port=4003"
astarte-appengine-api:
image: astarte/astarte_appengine_api:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_appengine_api
env_file:
- ./compose.env
environment:
APPENGINE_API_ROOMS_AMQP_CLIENT_HOST: rabbitmq
restart: on-failure
depends_on:
- rabbitmq
- scylla
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.astarte-appengine-api.rule=Host(`api.astarte.localhost`)"
- "traefik.http.routers.astarte-appengine-api.rule=PathPrefix(`/appengine`)"
- "traefik.http.routers.astarte-appengine-api.entrypoints=web"
- "traefik.http.routers.astarte-appengine-api.middlewares=astarte-appengine-api"
- "traefik.http.routers.astarte-appengine-api.service=astarte-appengine-api"
- "traefik.http.middlewares.astarte-appengine-api.stripprefix.prefixes=/appengine"
- "traefik.http.middlewares.astarte-appengine-api.stripprefix.forceSlash=false"
- "traefik.http.services.astarte-appengine-api.loadbalancer.server.port=4002"
astarte-data-updater-plant:
image: astarte/astarte_data_updater_plant:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_data_updater_plant
env_file:
- ./compose.env
environment:
DATA_UPDATER_PLANT_AMQP_CONSUMER_HOST: "rabbitmq"
DATA_UPDATER_PLANT_AMQP_PRODUCER_HOST: "rabbitmq"
DATA_UPDATER_PLANT_AMQP_PRODUCER_PORT: "5672"
DATA_UPDATER_PLANT_AMQP_PRODUCER_USERNAME: "guest"
DATA_UPDATER_PLANT_AMQP_PRODUCER_PASSWORD: "guest"
DATA_UPDATER_PLANT_AMQP_PRODUCER_VIRTUAL_HOST: "/"
restart: on-failure
depends_on:
- "rabbitmq"
- "scylla"
astarte-trigger-engine:
image: astarte/astarte_trigger_engine:snapshot
build:
dockerfile: ../../Dockerfile
context: apps/astarte_trigger_engine
env_file:
- ./compose.env
environment:
TRIGGER_ENGINE_AMQP_CONSUMER_HOST: "rabbitmq"
restart: on-failure
depends_on:
- "rabbitmq"
- "scylla"
astarte-dashboard:
image: astarte/astarte-dashboard:snapshot
volumes:
- ./compose/astarte-dashboard/config.json:/usr/share/nginx/html/user-config/config.json
depends_on:
- "astarte-realm-management-api"
- "astarte-appengine-api"
- "traefik"
labels:
- "traefik.enable=true"
- "traefik.http.routers.astarte-dashboard.rule=Host(`dashboard.astarte.localhost`)"
- "traefik.http.routers.astarte-dashboard.entrypoints=web"
- "traefik.http.routers.astarte-dashboard.service=astarte-dashboard"
- "traefik.http.services.astarte-dashboard.loadbalancer.server.port=80"
astarte-grafana:
image: astarte/grafana:snapshot
depends_on:
- "astarte-appengine-api"
- "traefik"
labels:
- "traefik.enable=true"
- "traefik.http.routers.astarte-grafana.rule=Host(`grafana.astarte.localhost`)"
- "traefik.http.routers.astarte-grafana.entrypoints=web"
- "traefik.http.routers.astarte-grafana.service=astarte-grafana"
- "traefik.http.services.astarte-grafana.loadbalancer.server.port=3000"
traefik:
image: traefik:v2.9
restart: on-failure
command:
# Uncomment this if you want to enable Traefik's web UI
# - "--api.insecure=true"
# Tells Traefik to listen to docker
- "--providers.docker"
# Don't expose everything
- "--providers.docker.exposedbydefault=false"
# Expose Astarte API/Dahsboard/Grafana
- "--entrypoints.web.address=:80"
# Expose Astarte broker
- "--entryPoints.vernemq.address=:8883"
ports:
# The HTTP port
- "80:80"
# Uncomment this if you want to display Traefik's web UI (enabled by --api.insecure=true)
# - "8080:8080"
# VerneMQ's SSL Listener
- "8883:8883"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
networks:
default:
aliases:
# Create traefik aliases for its hosts, so that other containers
# in the same network can curl them.
- api.astarte.localhost
- dashboard.astarte.localhost
- grafana.astarte.localhost
- broker.astarte.localhost
# RabbitMQ
rabbitmq:
image: rabbitmq:3.12.0-management
restart: on-failure
volumes:
- rabbitmq-data:/var/lib/rabbitmq
# CFSSL
cfssl:
image: astarte/cfssl:1.5.0-astarte.4
volumes:
- ./compose/cfssl-config:/config
- cfssl-data:/data
command: cfssl serve -address=0.0.0.0 -ca=/data/ca.pem -ca-key=/data/ca-key.pem -port=8080 -config=/etc/cfssl/ca_root_config.json
# Restart if we fail
restart: on-failure
# Scylla
scylla:
image: scylladb/scylla:5.2.2
restart: on-failure
volumes:
- scylla-data:/var/lib/scylla
# VerneMQ
vernemq:
image: astarte/vernemq:snapshot
env_file:
- ./compose.env
environment:
DOCKER_VERNEMQ_LISTENER__SSL__DEFAULT__CAFILE: "/opt/vernemq/etc/ca.pem"
DOCKER_VERNEMQ_LISTENER__SSL__DEFAULT__CERTFILE: "/opt/vernemq/etc/cert.pem"
DOCKER_VERNEMQ_LISTENER__SSL__DEFAULT__KEYFILE: "/opt/vernemq/etc/privkey.pem"
DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__AMQP__USERNAME: "guest"
DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__AMQP__PASSWORD: "guest"
DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__AMQP__HOST: "rabbitmq"
DOCKER_VERNEMQ_USER_appengine: "appengine"
DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__NODES: "scylla:9042"
CFSSL_URL: "http://cfssl:8080"
volumes:
- vernemq-data:/opt/vernemq/data
- ./compose/vernemq-certs:/etc/ssl/vernemq-certs
depends_on:
- "cfssl"
- "rabbitmq"
- "traefik"
# Ensure we wait for rabbit and cfssl
command: wait-for rabbitmq:5672 -t 90 -- wait-for cfssl:8080 -t 90 -- /opt/vernemq/bin/vernemq.sh
# Restart if we fail
restart: on-failure
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.vernemq.rule=HostSNI(`broker.astarte.localhost`)"
- "traefik.tcp.routers.vernemq.entrypoints=vernemq"
- "traefik.tcp.routers.vernemq.tls.passthrough=true"
- "traefik.tcp.routers.vernemq.service=vernemq"
- "traefik.tcp.services.vernemq.loadbalancer.server.port=8883"
volumes:
rabbitmq-data:
scylla-data:
vernemq-data:
cfssl-data:
networks:
default:
name: astarte