version: '3.3' services: registry: image: registry:2 environment: REGISTRY_AUTH: htpasswd REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm volumes: - registry:/var/lib/registry - auth:/auth # ports: # - 5000:5000 networks: - traefik-network deploy: mode: replicated replicas: 1 resources: limits: cpus: '0.05' memory: 64M #1024M reservations: cpus: '0.05' memory: 64M placement: constraints: - node.role == manager - node.hostname == hetzner labels: - "traefik.enable=true" - traefik.docker.network=traefik-network - traefik.constraint-label=traefik-network - traefik.http.routers.registry-http.middlewares=http-to-https - traefik.http.routers.registry-https.rule=Host(`registry.odamus.com`) - traefik.http.routers.registry-https.entrypoints=websecure - traefik.http.routers.registry-http.rule=Host(`registry.odamus.com`) - traefik.http.routers.registry-http.entrypoints=web - "traefik.http.routers.registry-https.tls.certresolver=mychallenge" - "traefik.http.services.registry.loadbalancer.server.port=5000" volumes: registry: auth: networks: traefik-network: external: true