mirror of
https://github.com/Dokploy/templates.git
synced 2026-07-08 15:35:24 +02:00
57 lines
1.1 KiB
TOML
57 lines
1.1 KiB
TOML
[variables]
|
|
main_domain = "${domain}"
|
|
username = "${username}"
|
|
password = "${password:32}"
|
|
|
|
[[config.domains]]
|
|
serviceName = "registry"
|
|
port = 5_000
|
|
host = "${main_domain}"
|
|
|
|
[config.env]
|
|
USERNAME = "${username}"
|
|
PASSWORD = "${password}"
|
|
|
|
[[config.mounts]]
|
|
filePath = "./config.yml"
|
|
content = """
|
|
version: 0.1
|
|
|
|
log:
|
|
fields:
|
|
service: registry
|
|
storage:
|
|
cache:
|
|
blobdescriptor: inmemory
|
|
filesystem:
|
|
rootdirectory: /var/lib/registry
|
|
http:
|
|
addr: :5000
|
|
headers:
|
|
X-Content-Type-Options: [nosniff]
|
|
health:
|
|
storagedriver:
|
|
enabled: true
|
|
interval: 10s
|
|
threshold: 3
|
|
"""
|
|
|
|
[[config.mounts]]
|
|
filePath = "./entrypoint.sh"
|
|
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
|
|
"""
|