-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose-things-local.yml
More file actions
200 lines (199 loc) · 8.72 KB
/
Copy pathdocker-compose-things-local.yml
File metadata and controls
200 lines (199 loc) · 8.72 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
services:
coap-calculator-simple:
build:
context: ./things/calculator
dockerfile: ./coap/js/Dockerfile-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}
networks:
- things_network
coap-calculator-content-negotiation:
build:
context: ./things/calculator
dockerfile: ./coap/js/Dockerfile-contentneg
labels:
- traefik.udp.routers.coap-calculator-content-negotiation.entrypoints=coap-calculator-content-negotiation
- traefik.udp.services.coap-calculator-simple.loadbalancer.server.port=${COAP_NEGOTIATION_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${COAP_NEGOTIATION_PORT_OUT}
networks:
- things_network
http-express-calculator-simple:
build:
context: ./things/calculator
dockerfile: ./http/express/Dockerfile-simple
labels:
- traefik.http.routers.http-express-calculator-simple.rule=PathPrefix(`/http-express-calculator-simple`)
- traefik.http.services.http-express-calculator-simple.loadbalancer.server.port=${WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
healthcheck:
test: wget --no-verbose --tries=1 --spider http://${STACK_HOSTNAME}:${WEB_PORT_OUT}/http-express-calculator-simple || exit 1
interval: ${HC_INTERVAL}
timeout: ${HC_TIMEOUT}
retries: ${HC_RETRIES}
start_period: ${HC_START_PERIOD}
networks:
- things_network
http-express-calculator-content-negotiation:
build:
context: ./things/calculator
dockerfile: ./http/express/Dockerfile-contentneg
labels:
- traefik.http.routers.http-express-calculator-content-negotiation.rule=PathPrefix(`/http-express-calculator-content-negotiation`)
- traefik.http.services.http-express-calculator-content-negotiation.loadbalancer.server.port=${WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
healthcheck:
test: wget --no-verbose --tries=1 --spider http://${STACK_HOSTNAME}:${WEB_PORT_OUT}/http-express-calculator-content-negotiation || exit 1
interval: ${HC_INTERVAL}
timeout: ${HC_TIMEOUT}
retries: ${HC_RETRIES}
start_period: ${HC_START_PERIOD}
networks:
- things_network
http-flask-calculator:
build:
context: ./things/calculator
dockerfile: ./http/flask/Dockerfile
labels:
- traefik.http.routers.http-flask-calculator.rule=PathPrefix(`/http-flask-calculator`)
- traefik.http.services.http-flask-calculator.loadbalancer.server.port=${WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
healthcheck:
test: wget --no-verbose --tries=1 --spider http://${STACK_HOSTNAME}:${WEB_PORT_OUT}/http-flask-calculator || exit 1
interval: ${HC_INTERVAL}
timeout: ${HC_TIMEOUT}
retries: ${HC_RETRIES}
start_period: ${HC_START_PERIOD}
networks:
- things_network
mqtt-calculator:
build:
context: ./things/calculator
dockerfile: ./mqtt/js/Dockerfile
environment:
- BROKER_URI=${BROKER_URI}
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
networks:
- things_network
modbus-elevator:
build:
context: ./things/elevator
dockerfile: ./modbus/js/Dockerfile
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}
networks:
- things_network
http-advanced-coffee-machine:
build:
context: .
dockerfile: ./things/advanced-coffee-machine/http/ts/Dockerfile
labels:
- traefik.http.routers.http-advanced-coffee-machine.rule=PathPrefix(`/http-advanced-coffee-machine`)
- traefik.http.services.http-advanced-coffee-machine.loadbalancer.server.port=${WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
- JAEGER_ENDPOINT=${JAEGER_ENDPOINT}
networks:
- things_network
http-data-schema-thing:
build:
context: ./things/data-schema-thing
dockerfile: ./http/ts/Dockerfile
labels:
- traefik.http.routers.http-data-schema-thing.rule=PathPrefix(`/http-data-schema-thing`)
- traefik.http.services.http-data-schema-thing.loadbalancer.server.port=${WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
networks:
- things_network
counter-thing:
build:
context: ./things/counter-thing
dockerfile: ./http/ts/Dockerfile
labels:
- traefik.http.routers.counter-thing.rule=PathPrefix(`/counter-thing`)
- traefik.http.services.counter-thing.loadbalancer.server.port=${WEB_PORT_OUT}
environment:
- HOSTNAME=${STACK_HOSTNAME}
- PORT=${WEB_PORT_OUT}
- LOKI_HOSTNAME=${LOKI_HOSTNAME}
- LOKI_PORT=${LOKI_PORT}
networks:
- things_network
smart-home-presence-sensor:
build:
context: ./mashups/smart-home
dockerfile: ./dockerfiles/presence-sensor.Dockerfile
networks:
- things_network
smart-home-simple-coffee-machine:
build:
context: ./mashups/smart-home
dockerfile: ./dockerfiles/simple-coffee-machine.Dockerfile
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.services.smart-home-simple-coffee-machine.loadbalancer.server.port=${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_HOSTNAME=smart-home-simple-coffee-machine
- PORT=${WEB_PORT_OUT}
networks:
- things_network
smart-home-smart-clock:
build:
context: ./mashups/smart-home
dockerfile: ./dockerfiles/smart-clock.Dockerfile
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
- PORT=${SMART_HOME_SMART_CLOCK_PORT_OUT}
networks:
- things_network
smart-home-mashup:
build:
context: ./mashups/smart-home
dockerfile: ./dockerfiles/mashup.Dockerfile
environment:
- SIMPLE_COFFEE_MACHINE_HOSTNAME=smart-home-simple-coffee-machine
- PRESENCE_SENSOR_BROKER_URI=${BROKER_URI}
- 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
networks:
- things_network
networks:
things_network:
name: things_network
external: true