feat: Add docker registry (round 2)

This commit is contained in:
William 2024-11-08 10:08:25 +01:00
parent d921e18167
commit e17d2fabd7
4 changed files with 48 additions and 0 deletions

1
registry/.env.example Normal file
View File

@ -0,0 +1 @@
REGISTRY_HOST=registy.example.org

2
registry/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.env
registry/

10
registry/README.md Normal file
View File

@ -0,0 +1,10 @@
# About Registy
# How to setup
```bash
mkdir -p registry/data
cp .env.example .env
docker run --rm -it httpd htpasswd -Bbn test test > ./registry/registry.password
docker compose up -d
```

View File

@ -0,0 +1,35 @@
networks:
web:
external: true
volumes:
registry-data:
driver: local
services:
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:
- ./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