-
Notifications
You must be signed in to change notification settings - Fork 18
/
common.yml
170 lines (161 loc) · 5.5 KB
/
common.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
# WARNING: Do not deploy this tutorial configuration directly to a production environment
#
# The tutorial docker-compose files have not been written for production deployment and will not
# scale. A proper architecture has been sacrificed to keep the narrative focused on the learning
# goals, they are just used to deploy everything onto a single Docker machine. All FIWARE components
# are running at full debug and extra ports have been exposed to allow for direct calls to services.
# They also contain various obvious security flaws - passwords in plain text, no load balancing,
# no use of HTTPS and so on.
#
# This is all to avoid the need of multiple machines, generating certificates, encrypting secrets
# and so on, purely so that a single docker-compose file can be read as an example to build on,
# not use directly.
#
# When deploying to a production environment, please refer to the Helm Repository
# for FIWARE Components in order to scale up to a proper architecture:
#
# see: https://github.com/FIWARE/helm-charts/
#
version: "3.8"
services:
# @context file is served from here
ld-context:
labels:
org.fiware: 'tutorial'
image: httpd:alpine
hostname: context
container_name: fiware-ld-context
ports:
- "3004:80"
volumes:
- data-models:/usr/local/apache2/htdocs/
- type: bind
source: ${PWD}/conf/mime.types
target: /usr/local/apache2/conf/mime.types
read_only: true
healthcheck:
test: (wget --server-response --spider --quiet http://context/user-context.jsonld 2>&1 | awk 'NR==1{print $$2}'| grep -q -e "200") || exit 1
# Databases
mongo-db:
labels:
org.fiware: 'tutorial'
image: mongo:${MONGO_DB_VERSION}
hostname: mongo-db
container_name: db-mongo
expose:
- "${MONGO_DB_PORT}"
ports:
- "${MONGO_DB_PORT}:${MONGO_DB_PORT}" # localhost:27017
networks:
- default
volumes:
- mongo-db:/data/db
- mongo-config:/data/configdb
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
farmer:
labels:
org.fiware: 'tutorial'
image: quay.io/fiware/tutorials.forwarder
hostname: 'farmer'
container_name: cb-farmer
ports:
- 1027:80
environment:
- TENANT=farmer
- DEBUG=broker:*
devices:
labels:
org.fiware: 'tutorial'
image: quay.io/fiware/tutorials.forwarder
hostname: 'farmer'
container_name: cb-devices
ports:
- 1028:80
environment:
- TENANT=openiot
- DEBUG=broker:*
# Tutorial acts as a series of dummy IoT Sensors over HTTP
tutorial:
labels:
org.fiware: 'tutorial'
image: quay.io/fiware/tutorials.ngsi-ld
hostname: iot-sensors
container_name: fiware-tutorial
depends_on:
- mongo-db
networks:
default:
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:
- 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}
- OPENWEATHERMAP_KEY_ID=<ADD_YOUR_KEY_ID>
- TWITTER_CONSUMER_KEY=<ADD_YOUR_CONSUMER_KEY>
- TWITTER_CONSUMER_SECRET=<ADD_YOUR_CONSUMER_SECRET>
- MONGO_URL=mongodb://mongo-db:27017
- IOTA_JSON_LD_CONTEXT=http://context/ngsi-context.jsonld
- MOVE_TRACTOR=-1
# IoT-Agent is configured for the UltraLight Protocol
iot-agent:
labels:
org.fiware: 'tutorial'
image: quay.io/fiware/iotagent-ul:${ULTRALIGHT_VERSION}
hostname: iot-agent
container_name: fiware-iot-agent
depends_on:
- mongo-db
networks:
- default
expose:
- "${IOTA_NORTH_PORT}"
- "${IOTA_SOUTH_PORT}"
ports:
- "${IOTA_NORTH_PORT}:${IOTA_NORTH_PORT}" # localhost:4041
- "${IOTA_SOUTH_PORT}:${IOTA_SOUTH_PORT}" # localhost:7896
environment:
- 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_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}
- IOTA_CB_NGSI_VERSION=ld # use NGSI-LD when sending updates for active attributes
- IOTA_JSON_LD_CONTEXT=http://context/user-context.jsonld
- IOTA_FALLBACK_TENANT=openiot
- IOTA_MULTI_CORE=true
healthcheck:
interval: 5s
networks:
default:
labels:
org.fiware: 'tutorial'
ipam:
config:
- subnet: 172.18.1.0/24
volumes:
mongo-db: ~
mongo-config: ~
data-models:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/data-models