
version: '3'

services:
  grafana:
    image: grafana/grafana
    container_name: grafana
    networks:
      - backend
    volumes:
      # Data persistency
      # sudo mkdir -p /srv/docker/grafana/data; chown 472:472 /srv/docker/grafana/data
      - "${DIR}/grafana:/var/lib/grafana"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.grafana.rule=Host(`grafana.${DOMAIN}`)"
      - "traefik.http.routers.grafana.entrypoints=web"
      - "traefik.http.services.grafana-service.loadbalancer.server.port=3000"

  influx:
    image: quay.io/influxdb/influxdb:2.0.0-beta
    container_name: influxdb
    networks:
      - backend
    ports:
      - 9999:9999
    labels:
      - "traefik.http.routers.influx.entryPoints=port8086"
      - "traefik.http.routers.influx.rule=host(`influx.${DOMAIN}`)"
      - "traefik.http.services.influx-service.loadBalancer.server.port=8086"
    restart: always
    environment:
      - INFLUX_TOKEN=-I2TAAlmXdJ06yMw9wf-Mztf83ZzYZUdE8Ov2hMrnYabvXUnxL2cZfDzNHR6LTbW7ND5rE95CdvV2-Cy8IMHZQ==

  telegraf:
    container_name: telegraf
    image: 'telegraf'
    restart: always
    networks:
      - backend
    ports:
      - 8081:8081
    environment:
      - INFLUX_TOKEN=-I2TAAlmXdJ06yMw9wf-Mztf83ZzYZUdE8Ov2hMrnYabvXUnxL2cZfDzNHR6LTbW7ND5rE95CdvV2-Cy8IMHZQ==
    volumes:
      - ./telegraf.conf:/etc/telegraf/telegraf.conf
      - /var/run/docker.sock:/var/run/docker.sock




networks:
  frontend:
    external: true
  backend:
    external: false

