forked from FIWARE/tutorials.Application-Mashup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
287 lines (265 loc) · 8.27 KB
/
docker-compose.yml
File metadata and controls
287 lines (265 loc) · 8.27 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
version: "3.8"
services:
wirecloud:
image: fiware/wirecloud:${WIRECLOUD_VERSION}
container_name: fiware-wirecloud
hostname: wirecloud
ports:
- "${WIRECLOUD_PORT}:${WIRECLOUD_PORT}" # localhost:8000
networks:
default:
ipv4_address: 172.18.1.10
restart: always
depends_on:
- keyrock
- elasticsearch
- memcached
- postgres-db
environment:
- DEBUG=True
- DEFAULT_THEME=wirecloud.defaulttheme
- DB_HOST=postgres-db
- DB_PASSWORD=wirepass # Change this password!
- FORWARDED_ALLOW_IPS=*
- ELASTICSEARCH2_URL=http://elasticsearch:9200/
- MEMCACHED_LOCATION=memcached:11211
- FIWARE_IDM_PUBLIC_URL=http://localhost:${KEYROCK_PORT}
- FIWARE_IDM_SERVER=http://172.18.1.5:${KEYROCK_PORT}
- SOCIAL_AUTH_FIWARE_KEY=wirecloud-dckr-site-0000-00000000000
- SOCIAL_AUTH_FIWARE_SECRET=wirecloud-docker-000000-clientsecret
volumes:
- wirecloud-data:/opt/wirecloud_instance/data
- wirecloud-static:/var/www/static
keyrock:
labels:
org.fiware: 'tutorial'
image: fiware/idm:${KEYROCK_VERSION}
container_name: fiware-keyrock
hostname: keyrock
networks:
default:
ipv4_address: 172.18.1.5
depends_on:
- mysql-db
ports:
- "${KEYROCK_PORT}:${KEYROCK_PORT}" # localhost:3005
- "${KEYROCK_HTTPS_PORT}:${KEYROCK_HTTPS_PORT}" # localhost:3443
environment:
- DEBUG=idm:*
- IDM_DB_HOST=mysql-db
- IDM_DB_PASS_FILE=/run/secrets/my_secret_data
- IDM_DB_USER=root
- IDM_HOST=http://localhost:${KEYROCK_PORT}
- IDM_PORT=${KEYROCK_PORT}
- IDM_ADMIN_USER=alice
- IDM_ADMIN_EMAIL=alice-the-admin@test.com
- IDM_ADMIN_PASS=test
secrets:
- my_secret_data
healthcheck:
interval: 5s
orion:
labels:
org.fiware: 'tutorial'
image: fiware/orion:${ORION_VERSION}
container_name: fiware-orion
depends_on:
- mongo-db
networks:
- default
expose:
- "${ORION_PORT}"
ports:
- "${ORION_PORT}:${ORION_PORT}" # localhost:1026
command: -dbhost mongo-db -logLevel DEBUG
healthcheck:
test: curl --fail -s http://orion:${ORION_PORT}/version || exit 1
interval: 5s
iot-agent:
labels:
org.fiware: 'tutorial'
image: fiware/iotagent-ul:${ULTRALIGHT_VERSION}
hostname: iot-agent
container_name: fiware-iot-agent
depends_on:
- mongo-db
- orion
networks:
- default
ports:
- "${IOTA_NORTH_PORT}:${IOTA_NORTH_PORT}" # localhost:4041
- "${IOTA_SOUTH_PORT}:${IOTA_SOUTH_PORT}" # localhost:7896
environment:
- IOTA_CB_HOST=orion # name of the context broker to update context
- IOTA_CB_PORT=${ORION_PORT} # port the context broker listens on to update context
- IOTA_NORTH_PORT=${IOTA_NORTH_PORT}
- IOTA_REGISTRY_TYPE=mongodb #Whether to hold IoT device info in memory or in a database
- IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
- IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
- IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
- IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
- IOTA_MONGO_HOST=mongo-db # The host name of MongoDB
- IOTA_MONGO_PORT=${MONGO_DB_PORT} # The port mongoDB is listening on
- IOTA_MONGO_DB=iotagentul # The name of the database used in mongoDB
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
healthcheck:
interval: 5s
tutorial:
labels:
org.fiware: 'tutorial'
image: fiware/tutorials.context-provider
hostname: iot-sensors
container_name: fiware-tutorial
depends_on:
orion :
condition: service_started
iot-agent :
condition: service_started
keyrock :
condition: service_started
networks:
default:
ipv4_address: 172.18.1.7
aliases:
- tutorial
- context-provider
expose:
- "${TUTORIAL_APP_PORT}"
- "${TUTORIAL_DUMMY_DEVICE_PORT}"
ports:
- "${TUTORIAL_APP_PORT}:${TUTORIAL_APP_PORT}" # localhost:3000
- "${TUTORIAL_DUMMY_DEVICE_PORT}:${TUTORIAL_DUMMY_DEVICE_PORT}" # localhost:3001
environment:
- "MONGO_URL=mongodb://mongo-db:27017"
- "DEBUG=tutorial:*"
- "WEB_APP_PORT=${TUTORIAL_APP_PORT}" # Port used by the content provider proxy and web-app for viewing data
- "IOTA_HTTP_HOST=iot-agent"
- "IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}"
- "DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT}" # Port used by the dummy IOT devices to receive commands
- "DUMMY_DEVICES_TRANSPORT=HTTP" # Default transport used by dummy Io devices
- "DUMMY_DEVICES_API_KEY=4jggokgpepnvsb2uv4s40d59ov"
- "CONTEXT_BROKER=http://orion:${ORION_PORT}/v2" # URL of the context broker to update context
- "OPENWEATHERMAP_KEY_ID=<ADD_YOUR_KEY_ID>"
- "TWITTER_CONSUMER_KEY=<ADD_YOUR_CONSUMER_KEY>"
- "TWITTER_CONSUMER_SECRET=<ADD_YOUR_CONSUMER_SECRET>"
- "NGSI_LD_PREFIX="
- "SECURE_ENDPOINTS=true"
- "KEYROCK_URL=http://localhost"
- "KEYROCK_IP_ADDRESS=http://172.18.1.5"
- "KEYROCK_PORT=${KEYROCK_PORT}"
- "KEYROCK_CLIENT_ID=tutorial-dckr-site-0000-xpresswebapp"
- "KEYROCK_CLIENT_SECRET=tutorial-dckr-site-0000-clientsecret"
- "CALLBACK_URL=http://localhost:${TUTORIAL_APP_PORT}/login"
healthcheck:
test: curl --fail -s http://tutorial:${TUTORIAL_APP_PORT}/version || exit 1
# Databases
postgres-db:
image: postgres
hostname: postgres-db
container_name: db-postgres
restart: always
ports:
- "${POSTGRES_DB_PORT}:${POSTGRES_DB_PORT}"
networks:
default:
ipv4_address: 172.18.1.13
environment:
- POSTGRES_PASSWORD=wirepass # Change this password!
volumes:
- postgres-db:/var/lib/postgresql/data
mysql-db:
restart: always
labels:
org.fiware: 'tutorial'
image: mysql:${MYSQL_DB_VERSION}
hostname: mysql-db
container_name: db-mysql
expose:
- "${MYSQL_DB_PORT}"
ports:
- "${MYSQL_DB_PORT}:${MYSQL_DB_PORT}" # localhost:3306
networks:
default:
ipv4_address: 172.18.1.6
environment:
- "MYSQL_ROOT_PASSWORD_FILE=/run/secrets/my_secret_data"
- "MYSQL_ROOT_HOST=172.18.1.5" # Allow Keyrock to access this database
volumes:
- mysql-db:/var/lib/mysql
- ./mysql-data:/docker-entrypoint-initdb.d/:ro # Preload Keyrock Users
secrets:
- my_secret_data
mongo-db:
labels:
org.fiware: 'tutorial'
image: mongo:${MONGO_DB_VERSION}
hostname: mongo-db
container_name: db-mongo
ports:
- "${MONGO_DB_PORT}:${MONGO_DB_PORT}" # localhost:27017
networks:
default: ~
volumes:
- mongo-db:/data
healthcheck:
test: |
host=`hostname --ip-address || echo '127.0.0.1'`;
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
interval: 5s
# Other services
ngsi-proxy:
image: fiware/ngsiproxy:1.2.0
hostname: ngsi-proxy
container_name: wc-ngsi-proxy
networks:
default:
ipv4_address: 172.18.1.14
expose:
- "8100"
ports:
- "8100:8100"
environment:
- PORT=8100
- TRUST_PROXY_HEADERS=0
elasticsearch:
image: elasticsearch:2.4
container_name: wc-elasticsearch
hostname: elasticsearch
ports:
- "9200:9200"
networks:
default:
ipv4_address: 172.18.1.12
restart: always
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
command: elasticsearch -Des.index.max_result_window=50000
memcached:
image: memcached:1
container_name: wc-memcached
hostname: memcached
ports:
- "11211:11211"
networks:
default:
ipv4_address: 172.18.1.11
restart: always
command: memcached -m 2048m
networks:
default:
labels:
org.fiware: 'tutorial'
ipam:
config:
- subnet: 172.18.1.0/24
volumes:
mysql-db: ~
postgres-db: ~
elasticsearch-data: ~
wirecloud-static: ~
wirecloud-data: ~
mongo-db: ~
secrets:
my_secret_data:
file: ./secrets.txt