version: '3.2'
services:
  mosquitto:
    # https://hub.docker.com/_/eclipse-mosquitto
    image: eclipse-mosquitto:2.0
    restart: always
    ports:
      - 1883:1883
    volumes:
      - ./mosquitto.conf:/mosquitto/config/mosquitto.conf

  influxdb:
    # https://hub.docker.com/_/influxdb
    image: influxdb:2.6
    restart: always
    ports:
      - 8086:8086
    volumes:
      - influxdb2:/var/lib/influxdb2

  grafana:
    # https://hub.docker.com/r/grafana/grafana
    image: grafana/grafana:9.3.6
    depends_on:
      - influxdb
    restart: always
    ports:
      - 3000:3000
    volumes:
      - grafana-dashboards:/var/lib/grafana
      - grafana-data:/data/
      - ../dashboard/grafana.ini:/etc/grafana/grafana.ini

  nodered:
    # https://hub.docker.com/r/grafana/grafana
    # https://nodered.org/docs/getting-started/docker
    depends_on:
      - influxdb
    restart: always
    ports:
      - 1880:1880
    environment:
      - TZ=Europe/Berlin
      - NODE_RED_ENABLE_PROJECTS=true
      - FLOWS=flows.json
    volumes:
      - nodered-data:/data
    build: ../flow

volumes:
  influxdb2:
  grafana-dashboards: 
  grafana-data: 
  nodered-data:

