Repository navigation
Expand file tree
/
Copy pathdocker-compose-things.yml
More file actions
349 lines (348 loc) · 15.1 KB
/
Copy pathdocker-compose-things.yml
File metadata and controls
349 lines (348 loc) · 15.1 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
services:
coap-calculator-simple:
image: thingweb/test-things-coap-calculator-simple
labels:
- traefik.udp.routers.coap-calculator-simple.entrypoints=coap-calculator-simple
- traefik.udp.services.coap-calculator-simple.loadbalancer.server.port=${COAP_SIMPLE_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${COAP_SIMPLE_PORT_OUT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 50M
reservations:
cpus: "0.01"
memory: 25M
networks:
- things_network
coap-calculator-content-negotiation:
image: thingweb/test-things-coap-calculator-content-negotiation
labels:
- traefik.udp.routers.coap-calculator-content-negotiation.entrypoints=coap-calculator-content-negotiation
- traefik.udp.services.coap-calculator-content-negotiation.loadbalancer.server.port=${COAP_NEGOTIATION_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${COAP_NEGOTIATION_PORT_OUT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 50M
reservations:
cpus: "0.01"
memory: 25M
networks:
- things_network
http-express-calculator-simple:
image: thingweb/test-things-http-express-calculator-simple
labels:
- traefik.http.routers.http-express-calculator-simple.rule=PathPrefix(`/http-express-calculator-simple`)
- traefik.http.routers.http-express-calculator-simple.entrypoints=web
- traefik.http.routers.http-express-calculator-simple-secure.rule=PathPrefix(`/http-express-calculator-simple`)
- traefik.http.routers.http-express-calculator-simple-secure.entrypoints=websecure
- traefik.http.routers.http-express-calculator-simple-secure.tls=true
- traefik.http.services.http-express-calculator-simple.loadbalancer.server.port=${SECURE_WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${SECURE_WEB_PORT_OUT}
- EXTERNAL_PORT=${SECURE_WEB_PORT_OUT}
- PROTOCOL=https
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
- LOKI_PROTOCOL=http
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
pids: 250
reservations:
cpus: "0.01"
memory: 128M
healthcheck:
test: wget --no-verbose --tries=1 --spider https://${STACK_HOSTNAME}:${SECURE_WEB_PORT_OUT}/http-express-calculator-simple
interval: ${HC_INTERVAL}
timeout: ${HC_TIMEOUT}
retries: ${HC_RETRIES}
start_period: ${HC_START_PERIOD}
networks:
- things_network
http-express-calculator-content-negotiation:
image: thingweb/test-things-http-express-calculator-content-negotiation
labels:
- traefik.http.routers.http-express-calculator-content-negotiation.rule=PathPrefix(`/http-express-calculator-content-negotiation`)
- traefik.http.routers.http-express-calculator-content-negotiation.entrypoints=web
- traefik.http.routers.http-express-calculator-content-negotiation-secure.rule=PathPrefix(`/http-express-calculator-content-negotiation`)
- traefik.http.routers.http-express-calculator-content-negotiation-secure.entrypoints=websecure
- traefik.http.routers.http-express-calculator-content-negotiation-secure.tls=true
- traefik.http.services.http-express-calculator-content-negotiation.loadbalancer.server.port=${SECURE_WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${SECURE_WEB_PORT_OUT}
- EXTERNAL_PORT=${SECURE_WEB_PORT_OUT}
- PROTOCOL=https
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
pids: 250
reservations:
cpus: "0.01"
memory: 128M
healthcheck:
test: wget --no-verbose --tries=1 --spider https://${STACK_HOSTNAME}:${SECURE_WEB_PORT_OUT}/http-express-calculator-content-negotiation
interval: ${HC_INTERVAL}
timeout: ${HC_TIMEOUT}
retries: ${HC_RETRIES}
start_period: ${HC_START_PERIOD}
networks:
- things_network
http-flask-calculator:
image: thingweb/test-things-flask-calculator
labels:
- traefik.http.routers.http-flask-calculator.rule=PathPrefix(`/http-flask-calculator`)
- traefik.http.routers.http-flask-calculator.entrypoints=web
- traefik.http.routers.http-flask-calculator-secure.rule=PathPrefix(`/http-flask-calculator`)
- traefik.http.routers.http-flask-calculator-secure.entrypoints=websecure
- traefik.http.routers.http-flask-calculator-secure.tls=true
- traefik.http.services.http-flask-calculator.loadbalancer.server.port=${SECURE_WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${SECURE_WEB_PORT_OUT}
- EXTERNAL_PORT=${SECURE_WEB_PORT_OUT}
- PROTOCOL=https
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
reservations:
cpus: "0.01"
memory: 128M
healthcheck:
test: wget --no-verbose --tries=1 --spider https://${STACK_HOSTNAME}:${SECURE_WEB_PORT_OUT}/http-flask-calculator
interval: ${HC_INTERVAL}
timeout: ${HC_TIMEOUT}
retries: ${HC_RETRIES}
start_period: ${HC_START_PERIOD}
networks:
- things_network
mqtt-calculator:
image: thingweb/test-things-mqtt-calculator
environment:
- BROKER_URI=${BROKER_URI}
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 50M
reservations:
cpus: "0.01"
memory: 25M
networks:
- things_network
modbus-elevator:
image: thingweb/test-things-modbus-elevator
labels:
- traefik.tcp.routers.modbus-elevator.entrypoints=modbus-elevator
- traefik.tcp.routers.modbus-elevator.rule=HostSNI(`*`)
- traefik.tcp.services.modbus-elevator.loadbalancer.server.port=${MODBUS_ELEVATOR_PORT_OUT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 50M
reservations:
cpus: "0.01"
memory: 25M
networks:
- things_network
http-advanced-coffee-machine:
image: thingweb/test-things-http-advanced-coffee-machine
labels:
- traefik.http.routers.http-advanced-coffee-machine.rule=PathPrefix(`/http-advanced-coffee-machine`)
- traefik.http.routers.http-advanced-coffee-machine.entrypoints=web
- traefik.http.routers.http-advanced-coffee-machine-secure.rule=PathPrefix(`/http-advanced-coffee-machine`)
- traefik.http.routers.http-advanced-coffee-machine-secure.entrypoints=websecure
- traefik.http.routers.http-advanced-coffee-machine-secure.tls=true
- traefik.http.services.http-advanced-coffee-machine.loadbalancer.server.port=${SECURE_WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${SECURE_WEB_PORT_OUT}
- EXTERNAL_PORT=${SECURE_WEB_PORT_OUT}
- PROTOCOL=https
- JAEGER_ENDPOINT=${JAEGER_ENDPOINT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
reservations:
cpus: "0.01"
memory: 128M
networks:
- things_network
http-data-schema-thing:
image: thingweb/test-things-http-data-schema-thing
labels:
- traefik.http.routers.http-data-schema-thing.rule=PathPrefix(`/http-data-schema-thing`)
- traefik.http.routers.http-data-schema-thing.entrypoints=web
- traefik.http.routers.http-data-schema-thing-secure.rule=PathPrefix(`/http-data-schema-thing`)
- traefik.http.routers.http-data-schema-thing-secure.entrypoints=websecure
- traefik.http.routers.http-data-schema-thing-secure.tls=true
- traefik.http.services.http-data-schema-thing.loadbalancer.server.port=${SECURE_WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${SECURE_WEB_PORT_OUT}
- EXTERNAL_PORT=${SECURE_WEB_PORT_OUT}
- PROTOCOL=https
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
reservations:
cpus: "0.01"
memory: 128M
networks:
- things_network
counter-thing:
image: thingweb/test-things-counter
labels:
- traefik.http.routers.counter-thing.rule=Host(`${STACK_HOSTNAME}`) && PathPrefix(`/counter`)
- traefik.http.routers.counter-thing.entrypoints=web
- traefik.http.routers.counter-thing.priority=100
- traefik.http.routers.counter-thing-secure.rule=Host(`${STACK_HOSTNAME}`) && PathPrefix(`/counter`)
- traefik.http.routers.counter-thing-secure.entrypoints=websecure
- traefik.http.routers.counter-thing-secure.tls=true
- traefik.http.services.counter-thing.loadbalancer.server.port=${SECURE_WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${SECURE_WEB_PORT_OUT}
- EXTERNAL_PORT=${SECURE_WEB_PORT_OUT}
- PROTOCOL=https
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
reservations:
cpus: "0.01"
memory: 128M
networks:
- things_network
smart-home-presence-sensor:
image: thingweb/test-things-smart-home-presence-sensor
restart: on-failure
environment:
- PRESENCE_SENSOR_BROKER_URI=${BROKER_URI}
- PRESENCE_SENSOR_BROKER_PORT=${BROKER_PORT}
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
reservations:
cpus: "0.01"
memory: 128M
networks:
- things_network
smart-home-simple-coffee-machine:
image: thingweb/test-things-smart-home-simple-coffee-machine
labels:
# TD is not exposed since it contains hostname that cannot be accessed outside the docker network
- traefik.http.routers.smart-home-simple-coffee-machine.rule=PathRegexp(`/smart-home-simple-coffee-machine/.+`)
- traefik.http.routers.smart-home-simple-coffee-machine.entrypoints=web
- traefik.http.routers.smart-home-simple-coffee-machine-secure.rule=PathPrefix(`/smart-home-simple-coffee-machine`)
- traefik.http.routers.smart-home-simple-coffee-machine-secure.entrypoints=websecure
- traefik.http.routers.smart-home-simple-coffee-machine-secure.tls=true
- traefik.http.services.smart-home-simple-coffee-machine.loadbalancer.server.port=${SECURE_WEB_PORT_OUT}
environment:
# Since mashup communicates inside the Docker network use of localhost in a TD result as
# the mashup container's its own localhost. Therefore hostname given as their docker service name.
# In production we will have a dedicated address and this issue won't be a problem.
- SIMPLE_COFFEE_MACHINE_PROTOCOL=https
- SIMPLE_COFFEE_MACHINE_HOSTNAME=${STACK_HOSTNAME}
- SIMPLE_COFFEE_MACHINE_PORT=${SECURE_WEB_PORT_OUT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
reservations:
cpus: "0.01"
memory: 128M
networks:
- things_network
smart-home-smart-clock:
image: thingweb/test-things-smart-home-smart-clock
labels:
- traefik.udp.routers.smart-home-smart-clock.entrypoints=smart-home-smart-clock
- traefik.udp.services.smart-home-smart-clock.loadbalancer.server.port=${SMART_HOME_SMART_CLOCK_PORT_OUT}
environment:
# Since mashup communicates inside the Docker network use of localhost in a TD result as
# the mashup container's its own localhost. Therefore hostname given as their docker service name.
# In production we will have a dedicated address and this issue won't be a problem.
- SMART_CLOCK_HOSTNAME=smart-home-smart-clock
- SMART_CLOCK_PORT=${SMART_HOME_SMART_CLOCK_PORT_OUT}
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 200M
reservations:
cpus: "0.01"
memory: 50M
networks:
- things_network
smart-home-mashup:
image: thingweb/test-things-smart-home-main
environment:
- SIMPLE_COFFEE_MACHINE_PROTOCOL=https
- SIMPLE_COFFEE_MACHINE_HOSTNAME=${STACK_HOSTNAME}
- SIMPLE_COFFEE_MACHINE_PATH=smart-home-simple-coffee-machine
- SIMPLE_COFFEE_MACHINE_PORT=${SECURE_WEB_PORT_OUT}
- PRESENCE_SENSOR_BROKER_URI=${BROKER_URI}
- PRESENCE_SENSOR_PORT=${BROKER_PORT}
- SMART_CLOCK_HOSTNAME=smart-home-smart-clock
- SMART_CLOCK_PORT=${SMART_HOME_SMART_CLOCK_PORT_OUT}
depends_on:
- smart-home-presence-sensor
- smart-home-simple-coffee-machine
- smart-home-smart-clock
restart: on-failure
deploy:
resources:
limits:
cpus: "0.05"
memory: 256M
reservations:
cpus: "0.01"
memory: 128M
networks:
- things_network
networks:
things_network:
name: things_network
external: true