version: '3' networks: public: {} volumes: grafana_lib: {} grafana_ds: services: influxdb: image: influxdb:alpine container_name: influxdb ports: - "8086:8086" networks: - public volumes: - ./data/influxdb:/var/lib/influxdb environment: INFLUXDB_REPORTING_DISABLED: "true" INFLUXDB_DB: telegraf INFLUXDB_USER: telegraf INFLUXDB_USER_PASSWORD: nimda grafana: image: grafana/grafana:5.1.3 container_name: grafana ports: - "3000:3000" networks: - public volumes: - grafana_lib:/var/lib/grafana - grafana_ds:/var/lib/grafana/ds:rw - ${PWD}/grafana/add_datasources.sh:/var/lib/grafana/ds/add_datasources.sh environment: GF_AUTH_ANONYMOUS_ENABLED: "true" GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin" INFLUXDB_URI: "http://influxdb:8086" INFLUXDB_DB: telegraf INFLUXDB_USER: telegraf INFLUXDB_USER_PASSWORD: nimda command: ["bash", "/var/lib/grafana/ds/add_datasources.sh"] telegraf: image: telegraf:latest container_name: telegraf network_mode: "host" volumes: - ./telegraf.conf:/etc/telegraf/telegraf.conf:ro environment: # real influx host INFLUXDB_URI: "http://localhost:8086"