infra-homelab/registry/docker-compose.yml
2024-11-08 11:01:38 +01:00

36 lines
1.1 KiB
YAML

networks:
web:
external: true
volumes:
registry-data:
driver: local
services:
registry:
restart: always
image: "registry:2.8.3"
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
volumes:
- ./registry/registry.password:/auth/registry.password
- registry-data:/data
labels:
- "traefik.enable=true"
- "traefik.http.services.registry-service.loadbalancer.server.port=5000"
- "traefik.http.routers.registry-http.entrypoints=web"
- "traefik.http.routers.registry-http.middlewares=https-redirect@docker"
- "traefik.http.routers.registry-http.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