infra-homelab/registry/docker-compose.yml
2024-11-07 09:28:30 +01:00

29 lines
1.0 KiB
YAML

registry:
restart: always
image: registry:latest
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
volumes:
# Mount the password file
- ./registry/registry.password:/auth/registry.password
# Mount the data directory
- ./registry/data:/data
labels:
- "traefik.enable=true"
- "traefik.http.services.registry.loadbalancer.server.port=5000"
- "traefik.http.routers.plausible.entrypoints=web"
- "traefik.http.routers.plausible.middlewares=https-redirect@docker"
- "traefik.http.routers.registry.rule=Host(`${REGISTRY_HOST}`)"
- "traefik.http.routers.registry-https.entrypoints=websecure"
- "traefik.http.routers.registry-https.tls=true"
- "traefik.http.routers.registry-https.tls.certresolver=letsencrypt"
- "traefik.http.routers.registry-https.rule=Host(`${REGISTRY_HOST}`)"
networks:
- web