services:

  traefik:
    image: traefik
    ports:
      - 8088:8088
    restart: always
    labels:
      - traefik.enable=true
      - traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080
      - traefik.http.routers.traefik-dashboard-http.entrypoints=http
      - traefik.http.routers.traefik-dashboard-http.rule=Host(`traefik.ultrabob.com`)
      - traefik.docker.network=traefik-public
      - traefik.http.routers.traefik-dashboard-http.service=api@internal
      - traefik.http.middlewares.admin-auth.basicauth.users=${USERNAME?Variable not set}:${HASHED_PASSWORD?Password not set}
      - traefik.http.routers.traefik-dashboard-http.middlewares=admin-auth
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    command:
      - --providers.docker
      - --providers.docker.exposedbydefault=false
      - --entrypoints.http.address=:8088
      - --accesslog
      - --log
      - --api
    networks:
      - traefik-public

networks:
  traefik-public:
    external: true
