diff --git a/README.md b/README.md index ab36ae0..c5ceae9 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ docker run -e DOMAIN=example.com \ ungleich/ungleich-certbot ``` +### Exiting after getting the certificate + +By default, the container will stay alive and try to renew the +certificate every 86400 seconds. If you set the environment variable +`ONLYGETCERT`, then it will only get the certificates and exit. + ## Volumes If you want to keep / use your certificates, you are advised to create @@ -35,4 +41,4 @@ a volume below /etc/letsencrypt. ## Kubernetes -Sample kubernetes usage: (TBD) +See https://code.ungleich.ch/ungleich-public/ungleich-k8s/. diff --git a/entrypoint.sh b/entrypoint.sh index 981dc27..a4f953d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,6 +26,10 @@ while [ ! -f "/etc/letsencrypt/live/${DOMAIN}/fullchain.pem" ]; do fi done +if [ "$ONLYGETCERT" ]; then + exit 0 +fi + # Try to renew once per day while true; do /usr/bin/certbot renew