version: "3.9" services: influxdb: image: influxdb:latest container_name: influxdb restart: unless-stopped ports: - "8086:8086" volumes: - ./influxdb/data:/var/lib/influxdb2 - ./influxdb/config:/etc/influxdb2 healthcheck: test: ["CMD", "curl", "-fsS", "http://localhost:8086/health"] interval: 5s timeout: 3s retries: 20 grafana: image: grafana/grafana:latest container_name: grafana restart: unless-stopped user: "0" ports: - "3000:3000" volumes: - ./grafana/data:/var/lib/grafana - ./grafana/config:/etc/grafana healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] interval: 5s timeout: 3s retries: 20 depends_on: influxdb: condition: service_healthy mqtt5: image: eclipse-mosquitto:latest container_name: mqtt5 restart: unless-stopped ports: - "1883:1883" - "9001:9001" volumes: - ./mosquitto/config:/mosquitto/config - ./mosquitto/data:/mosquitto/data - ./mosquitto/log:/mosquitto/log healthcheck: test: ["CMD-SHELL", "mosquitto_pub -h localhost -p 1883 -t healthcheck/ping -n >/dev/null 2>&1 || exit 1"] interval: 10s timeout: 5s retries: 12 telegraf: image: telegraf:latest container_name: telegraf restart: unless-stopped env_file: - .env volumes: - ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro depends_on: mqtt5: condition: service_healthy influxdb: condition: service_healthy healthcheck: test: ["CMD-SHELL", "pidof telegraf >/dev/null 2>&1 || exit 1"] interval: 10s timeout: 3s retries: 12 networks: default: name: mqtt5-network external: true