version: "3"
services:
 influxdb:
  image: influxdb:1.7-alpine
  restart: on-failure:5
  networks:
   - traefik_net
  volumes:
   - ./data/influx:/var/lib/influxdb/
  labels:
   - "traefik.enable=true"
   - "traefik.docker.network=traefik_net"
   - "traefik.http.frontend.rule=Host:iot-db.uni.clkl.de"

 grafana:
  image: grafana/grafana:5.4.3
  volumes:
   - "./data/grafana/:/var/lib/grafana/"
  environment:
   - "GF_SECURITY_ADMIN_USER=admin"
   - "GF_SECURITY_ADMIN_PASSWORD=secret"
  restart: on-failure:5
  networks:
   - traefik_net
   - default
  labels:
   - "traefik.enable=true"
   - "traefik.docker.network=traefik_net"
   - "traefik.http.frontend.rule=Host:iot.uni.clkl.de"


networks:
 traefik_net:
  external:
   name: traefik_net

# initialize DB: requests.post("http://iot-db.uni.clkl.de/query?q=CREATE DATABASE ids"