services: registry: image: registry:2.8 container_name: registry restart: unless-stopped networks: - traefik_proxy configs: - source: registry target: /etc/docker/registry/config.yml mode: 0400 volumes: - registry_registry:/var/lib/registry expose: - 5000 labels: - "traefik.enable=true" - "traefik.http.routers.registry.entrypoints=https" - "traefik.http.routers.registry.rule=Host(`docker.fanyx.xyz`)" - "traefik.http.middlewares.headers.Headers.sslProxyHeaders.X-Forwarded-Proto=https" - "traefik.http.middlewares.headers.Headers.hostsProxyHeaders=X-Forwarded-Host" - "traefik.http.middlewares.auth.BasicAuth.usersfile=/htpasswd" - "traefik.http.routers.registry.middlewares=headers@docker,auth@docker" volumes: registry_registry: external: true configs: registry: file: ./config.yml networks: traefik_proxy: name: traefik_proxy