nrec-ansible/project/roles/registry/templates/registry.service.j2

29 lines
867 B
Plaintext
Raw Normal View History

2022-01-12 20:25:11 +00:00
[Unit]
Description=Registry Container
After=docker.service
After=dockerdata.mount
Requires=docker.service
Requires=dockerdata.mount
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop registry
ExecStartPre=-/usr/bin/docker rm registry
ExecStartPre=-/usr/bin/docker pull registry:2
ExecStart=/usr/bin/docker run \
-e "REGISTRY_AUTH=htpasswd" \
-e "REGISTRY_AUTH_HTPASSWD_REALM=registry.t-juice.club" \
-e "REGISTRY_AUTH_HTPASSWD_PATH=/htpasswd" \
-l "traefik.enable=true" \
-l "traefik.http.routers.registry.rule=Host(`registry.t-juice.club`)" \
-l "traefik.http.routers.registry.tls=true" \
-l "traefik.http.routers.registry.tls.certresolver=le" \
-v /dockerdata/registry-data:/var/lib/registry \
-v /var/registry/htpasswd:/htpasswd \
--network proxy \
--name registry registry:2
[Install]
WantedBy=multi-user.target