mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 17:20:42 +00:00
feat(service): upgrade docker registry template (#7034)
Co-authored-by: 🏔️ Peak <122374094+peaklabs-dev@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# documentation: https://docs.docker.com/registry/
|
||||
# documentation: https://distribution.github.io/distribution/
|
||||
# slogan: The Docker Registry lets you distribute Docker images.
|
||||
# category: devtools
|
||||
# tags: registry,images,docker
|
||||
@@ -7,20 +7,35 @@
|
||||
|
||||
services:
|
||||
registry:
|
||||
image: registry:2
|
||||
image: registry:3
|
||||
environment:
|
||||
- SERVICE_URL_REGISTRY_5000
|
||||
- USERNAME=${SERVICE_USER_REGISTRY}
|
||||
- PASSWORD=${SERVICE_PASSWORD_REGISTRY}
|
||||
- REGISTRY_AUTH=htpasswd
|
||||
- REGISTRY_AUTH_HTPASSWD_REALM=Registry
|
||||
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
|
||||
- REGISTRY_AUTH_HTPASSWD_PATH=/auth/registry.password
|
||||
- REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data
|
||||
command: ["/entrypoint.sh"]
|
||||
volumes:
|
||||
- registry-data:/var/lib/registry
|
||||
- type: bind
|
||||
source: ./auth/registry.password
|
||||
target: /auth/registry.password
|
||||
isDirectory: false
|
||||
content: >-
|
||||
testuser:$2y$05$/o2JvmI2bhExXIt6Oqxa7ekYB7v3scj1wFEf6tBslJvJOMoPQL.Gy
|
||||
source: ./etc/entrypoint.sh
|
||||
target: /entrypoint.sh
|
||||
mode: "0755"
|
||||
content: |
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
if [ -z "$USERNAME" ] || [ -z "$PASSWORD" ]; then
|
||||
echo "Error: USERNAME and PASSWORD environment variables must be set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apk add --no-cache apache2-utils
|
||||
mkdir -p "$(dirname "$REGISTRY_AUTH_HTPASSWD_PATH")"
|
||||
chmod 755 "$(dirname "$REGISTRY_AUTH_HTPASSWD_PATH")"
|
||||
htpasswd -Bbc "$REGISTRY_AUTH_HTPASSWD_PATH" "$USERNAME" "$PASSWORD"
|
||||
registry serve /etc/docker/registry/config.yml
|
||||
- type: bind
|
||||
source: ./config/config.yml
|
||||
target: /etc/docker/registry/config.yml
|
||||
@@ -45,7 +60,13 @@ services:
|
||||
enabled: true
|
||||
interval: 10s
|
||||
threshold: 3
|
||||
- type: bind
|
||||
source: ./data
|
||||
target: /data
|
||||
isDirectory: true
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- wget
|
||||
- "-q"
|
||||
- "--spider"
|
||||
- "http://localhost:5000/"
|
||||
interval: 5s
|
||||
timeout: 20s
|
||||
retries: 10
|
||||
|
||||
Reference in New Issue
Block a user