# 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/ # services: # Orion is an NGSI-v2 context broker orion-v2: labels: org.fiware: 'tutorial' image: quay.io/fiware/orion:${ORION_VERSION} # image: telefonicaiot/fiware-orion:issue3884 hostname: orion container_name: fiware-orion depends_on: - mongo-db networks: - default expose: - "${ORION_PORT}" ports: - "${ORION_PORT}:${ORION_PORT}" # localhost:1026 command: -dbURI mongodb://mongo-db -logLevel DEBUG healthcheck: test: curl --fail -s http://orion:${ORION_PORT}/version || exit 1 interval: 5s # Quantum Leap is persisting Short Term History to Crate-DB quantumleap: image: orchestracities/quantumleap:${QUANTUMLEAP_VERSION} labels: org.fiware: 'tutorial' hostname: quantumleap container_name: fiware-quantumleap ports: - "${QUANTUMLEAP_PORT}:${QUANTUMLEAP_PORT}" depends_on: - crate-db - redis-db environment: - CRATE_HOST=crate-db - REDIS_HOST=redis-db - REDIS_PORT=${REDIS_PORT} - LOGLEVEL=DEBUG healthcheck: test: curl --fail -s http://quantumleap:${QUANTUMLEAP_PORT}/version || exit 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 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=INFO # 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 acts as a series of dummy IoT Sensors over HTTP tutorial: labels: org.fiware: 'tutorial' image: quay.io/fiware/tutorials.context-provider hostname: iot-sensors container_name: fiware-tutorial depends_on: - orion-v2 - quantumleap 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: - "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}" - "IOTA_DEFAULT_RESOURCE=/iot/d" - "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 - "CONTEXT_BROKER=http://orion:${ORION_PORT}/v2" # URL of the context broker to update context - "NGSI_LD_PREFIX=" - "CRATE_DB_SERVICE_URL=http://crate-db:4200/_sql" - "OPENWEATHERMAP_KEY_ID=" - "TWITTER_CONSUMER_KEY=" - "TWITTER_CONSUMER_SECRET=" # 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 healthcheck: test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"] interval: 5s timeout: 5s retries: 3 start_period: 5s crate-db: labels: org.fiware: 'tutorial' image: crate:${CRATE_VERSION} hostname: crate-db container_name: db-crate ports: # Admin UI - "4200:4200" # Transport protocol - "4300:4300" command: crate -Cauth.host_based.enabled=false -Ccluster.name=democluster -Chttp.cors.enabled=true -Chttp.cors.allow-origin="*" -Cdiscovery.type=single-node environment: - CRATE_HEAP_SIZE=2g # see https://crate.io/docs/crate/howtos/en/latest/deployment/containers/docker.html#troubleshooting volumes: - crate-db:/data redis-db: labels: org.fiware: 'tutorial' image: redis:${REDIS_VERSION} hostname: redis-db container_name: db-redis networks: - default ports: - "${REDIS_PORT}:${REDIS_PORT}" # localhost:6379 volumes: - redis-db:/data healthcheck: test: ["CMD", "redis-cli","ping"] interval: 10s # Other services grafana: labels: org.fiware: 'tutorial' image: grafana/grafana:8.5.27 container_name: grafana depends_on: - crate-db ports: - "3003:${TUTORIAL_APP_PORT}" environment: - GF_INSTALL_PLUGINS=orchestracities-map-panel,grafana-clock-panel,grafana-worldmap-panel volumes: - grafana:/var/lib/grafana networks: default: labels: org.fiware: 'tutorial' ipam: config: - subnet: 172.18.1.0/24 volumes: mongo-db: ~ crate-db: ~ redis-db: ~ grafana: ~