Skip to content

Commit 5a422bf

Browse files
committed
Update Device Emulator to use Redis
1 parent 7a14041 commit 5a422bf

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

docker-compose/common.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ services:
3535
healthcheck:
3636
test: (wget --server-response --spider --quiet http://context/user-context.jsonld 2>&1 | awk 'NR==1{print $$2}'| grep -q -e "200") || exit 1
3737

38+
# Cache for Sensor Data Readings
39+
redis-sensors:
40+
labels:
41+
org.fiware: 'tutorial'
42+
image: redis:8.2.0-alpine
43+
container_name: redis
44+
hostname: redis-for-sensors
45+
ports:
46+
- "6379:6379"
47+
volumes:
48+
- redis-data:/data
49+
healthcheck:
50+
test: ["CMD", "redis-cli","ping"]
51+
interval: 10s
52+
3853
# Databases
3954
mongo-db:
4055
labels:
@@ -105,6 +120,8 @@ services:
105120
image: quay.io/fiware/tutorials.iot-devices
106121
hostname: iot-sensors
107122
container_name: fiware-iot-devices
123+
depends_on:
124+
- redis-sensors
108125
networks:
109126
- default
110127
expose:
@@ -119,10 +136,7 @@ services:
119136
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}
120137
- PIG_COUNT=${PIG_COUNT}
121138
- COW_COUNT=${COW_COUNT}
122-
123-
124-
125-
139+
- REDIS_HOST=redis-for-sensors
126140

127141
credentials-config:
128142
labels:
@@ -322,6 +336,7 @@ volumes:
322336
mongo-config: ~
323337
mysql-trust-db: ~
324338
mysql-config-db: ~
339+
redis-data: ~
325340
data-models:
326341
driver: local
327342
driver_opts:

docker-compose/orion-ld.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
- default
3131
ports:
3232
- ${EXPOSED_PORT:-1026}:${ORION_LD_PORT:-1026}
33-
command: -dbhost mongo-db -logLevel INFO -forwarding -mongocOnly -wip entityMaps
33+
command: -dbhost mongo-db -logLevel DEBUG -forwarding -mongocOnly -wip entityMaps -t 0-255
3434
healthcheck:
3535
test: curl --fail -s http://orion:${ORION_LD_PORT}/version || exit 1
3636
interval: 30s

0 commit comments

Comments
 (0)