services:

  cadvisor:
    image: gcr.io/cadvisor/cadvisor:v0.52.0
    container_name: cadvisor
    command:
      - "--store_container_labels=false"
      - "--whitelisted_container_labels=com.docker.compose.project"
      - "--housekeeping_interval=60s"
      - "--docker_only=true"
      - "--disable_metrics=percpu,sched,tcp,udp,disk,diskIO,hugetlb,referenced_memory,cpu_topology,resctrl"
    networks:
      - traefikNet

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.cadvisor-secure.entrypoints=websecure"
      - "traefik.http.routers.cadvisor-secure.rule=Host(`cadvisor-${site}.${domain}`)"
      #- "traefik.http.routers.grafana-secure.tls=true"
      - "traefik.http.routers.cadvisor-secure.service=cadvisor"
      - "traefik.http.routers.cadvisor-secure.middlewares=test-adminipallowlist@file"
      - "traefik.http.services.cadvisor.loadbalancer.server.port=8080"
      - "traefik.docker.network=traefikNet"

#    ports:
#      - 8098:8080
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:ro
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
      - /dev/disk/:/dev/disk:ro
    devices:
      - /dev/kmsg
    privileged: true
    restart: unless-stopped

networks:
  traefikNet:
    external: true
    name: traefikNet

