feat: Add IoT-Agent integration - simulator publishes to smartcity-api-key/{sid}/attrs via EMQX

This commit is contained in:
Eric FELIXINE
2026-05-06 16:20:05 -04:00
parent 303d6f3eb2
commit 0c1b75fcd3
2 changed files with 58 additions and 26 deletions

View File

@@ -1,27 +1,38 @@
version: '3.8'
# IoT Agent JSON - Registry in Memory (no MongoDB needed)
# Usage: docker compose -f docker-compose.yml -f docker-compose.iot-agent.yml up -d
networks:
traefik-public:
external: true
smartcity-shared:
external: true
version: '3.8'
services:
iot-agent:
container_name: smart-city-iot-agent
image: fiware/iotagent-json:latest
container_name: smart-city-iot-agent
restart: unless-stopped
environment:
- IOTA_CB_HOST=fiware-gis-quickstart-orion-1
- IOTA_CB_PORT=1026
- IOTA_NORTH_PORT=4041
- IOTA_REGISTRY_TYPE=mongodb
- IOTA_MONGO_URL=mongodb://smart-city-mongodb:27017/iotagent
- IOTA_PROVIDER_URL=http://smart-city-iot-agent:4041
- IOTA_CB_NGSI_VERSION=ld
networks:
- smartcity-shared
- traefik-public
ports:
- "4041:4041"
environment:
# Context Broker (Stellio)
- IOTA_CB_HOST=stellio-api-gateway
- IOTA_CB_PORT=8080
- IOTA_CB_NGSI_VERSION=ld
# IoT Agent settings
- IOTA_NORTH_PORT=4041
- IOTA_REGISTRY_TYPE=memory
# MQTT Listener - connect to EMQX
- IOTA_MQTT_HOST=emqx_emqx_1
- IOTA_MQTT_PORT=1883
# No MongoDB needed - using memory registry
- IOTA_PROVIDER_URL=http://smart-city-iot-agent:4041
- IOTA_DEFAULT_RESOURCE=/
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:4041/version || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
labels:
- "traefik.enable=true"
- "traefik.http.routers.iot-agent.rule=Host(`iot-agent.digitribe.fr`)"
@@ -29,14 +40,8 @@ services:
- "traefik.http.routers.iot-agent.tls=true"
- "traefik.http.services.iot-agent.loadbalancer.server.port=4041"
iot-agent-mongodb:
container_name: smart-city-mongodb
image: mongo:4.4
restart: unless-stopped
networks:
- smartcity-shared
volumes:
- mongodb-data:/data/db
volumes:
mongodb-data:
networks:
smartcity-shared:
external: true
traefik-public:
external: true