  influxdb2:
    image: quay.io/influxdb/influxdb:v2.0.3
    container_name: influxdb2
    ports:
      - '8087:8086'
    environment:
      INFLUXDB_REPORTING_DISABLED: 'true'
    volumes:
      - ./docker/blocks/influxdb2/influxdb.conf:/etc/influxdb/influxdb.conf

  # Use the influx cli to set up an influxdb instance.
  influxdb2_cli:
    links:
      - influxdb2
    image: quay.io/influxdb/influxdb:v2.0.3
    # Use these same configurations parameters in your telegraf configuration, mytelegraf.conf.
    entrypoint: influx setup --bucket mybucket -t mytoken -o myorg --username=grafana --password=grafana12345 --host=http://influxdb2:8086 -f
      # Wait for the influxd service in the influxdb container has fully bootstrapped before trying to setup an influxdb instance with the influxdb_cli service.
    restart: on-failure:10
    depends_on:
      - influxdb2

  fake-influxdb2-data:
    image: grafana/fake-data-gen
    links:
      - influxdb2
    environment:
      FD_SERVER: influxdb2
      FD_DATASOURCE: influxdb
      FD_PORT: 8086

  telegraf2:
    image: telegraf
    links:
      - influxdb2
    depends_on:
      - influxdb2_cli
    volumes:
      - ./docker/blocks/influxdb2/telegraf.conf:/etc/telegraf/telegraf.conf:ro
      - /var/log:/var/log
      - ../data/log:/var/log/grafana
