services:
  netdata:
    image: netdata/netdata:stable
    container_name: netdata
    restart: unless-stopped

    pid: host
    cap_add:
      - SYS_PTRACE
      - SYS_ADMIN
      - NET_ADMIN

    volumes:
      - ./netdata/config:/etc/netdata
      - ./netdata/lib:/var/lib/netdata
      - ./netdata/cache:/var/cache/netdata
      - /etc/passwd:/host/etc/passwd:ro
      - /etc/group:/host/etc/group:ro
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /etc/os-release:/host/etc/os-release:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro

    environment:
      - TZ=Europe/Ljubljana

    networks:
      - traefik_default

    labels:
      - "traefik.enable=true"

      # Router
      - "traefik.http.routers.netdata.rule=Host(`netdata.rozic-dev.com`)"
      - "traefik.http.routers.netdata.entrypoints=websecure"
      - "traefik.http.routers.netdata.tls.certresolver=letsencrypt"
      - "traefik.http.routers.netdata.middlewares=netdata-auth"

      # Basic Auth middleware  #Dejan:biker111
      - "traefik.http.middlewares.netdata-auth.basicauth.users=Dejan:$$2y$$05$$KK9RbSGiTHmnYGAV0AeEf.gxZ1SIK1eW.E8PaP6koC1rHXFyTcHu2"

      # Service port
      - "traefik.http.services.netdata.loadbalancer.server.port=19999"
      - "traefik.docker.network=traefik_default"

networks:
  traefik_default:
    external: true
