services: proxy: image: traefik:v2.3 volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - "80:80" restart: always command: - --providers.docker - --providers.docker.constraints=Label(`traefik.constraint-label`, `traefik-public`) - --providers.docker.exposedbydefault=false - --entrypoints.http.address=:80 - --accesslog - --log - --api labels: - traefik.enable=true - traefik.constraint-label=traefik-public - traefik.http.middlewares.https-redirect.contenttype.autodetect=false - 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.localhost`) - traefik.http.routers.traefik-dashboard-http.service=api@internal - traefik.http.middlewares.admin-auth.basicauth.users=${USERNAME?Variable not set}:${HASHED_PASSWORD?Variable not set} - traefik.http.routers.traefik-dashboard-http.middlewares=admin-auth networks: traefik-public: external: false