From ab29d5a37f02189d256853e463555416edb69040 Mon Sep 17 00:00:00 2001 From: Yonn Trimoreau Date: Sun, 26 Jul 2020 20:55:25 +0200 Subject: [PATCH 1/2] Adds proper PID/GID management in Docker example --- docs/docker-compose-traefik-v1.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/docker-compose-traefik-v1.yml b/docs/docker-compose-traefik-v1.yml index ed64bd3..bd2e451 100644 --- a/docs/docker-compose-traefik-v1.yml +++ b/docs/docker-compose-traefik-v1.yml @@ -29,11 +29,18 @@ services: entrypoint: sh -c ' apk add jq ; while ! [ -e /data/acme.json ] - || ! [ `jq ".Certificates | length" /data/acme.json` != 0 ]; do + || ! [ `jq ".letsencrypt.Certificates | length" /data/acme.json` != 0 ]; do sleep 1 ; done - && traefik-certs-dumper file --watch - --source /data/acme.json --dest /data/certs' + ; if ! id -u traefik > /dev/null 2>&1; then + addgroup --gid ${PGID} traefik + ; adduser --disabled-password --gecos "" --ingroup traefik --uid ${PUID} traefik + ; else + groupmod -g ${PGID} -o traefik + ; usermod -u ${PUID} -o traefik + ; fi + ; su - traefik -c "traefik-certs-dumper file --watch + --source /data/acme.json --dest /data/certs"' volumes: - ./letsencrypt:/data From 4e4b26c0a21666f68989a48c6676624b20a4d0a8 Mon Sep 17 00:00:00 2001 From: Yonn Trimoreau Date: Sun, 26 Jul 2020 20:57:14 +0200 Subject: [PATCH 2/2] Traefik v1 compatibility (rollback) --- docs/docker-compose-traefik-v1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docker-compose-traefik-v1.yml b/docs/docker-compose-traefik-v1.yml index bd2e451..c2ccaed 100644 --- a/docs/docker-compose-traefik-v1.yml +++ b/docs/docker-compose-traefik-v1.yml @@ -29,7 +29,7 @@ services: entrypoint: sh -c ' apk add jq ; while ! [ -e /data/acme.json ] - || ! [ `jq ".letsencrypt.Certificates | length" /data/acme.json` != 0 ]; do + || ! [ `jq ".Certificates | length" /data/acme.json` != 0 ]; do sleep 1 ; done ; if ! id -u traefik > /dev/null 2>&1; then