diff --git a/docker/scripts/0-create-cert.sh b/docker/scripts/0-create-cert.sh index 6572e4c..2392c6d 100644 --- a/docker/scripts/0-create-cert.sh +++ b/docker/scripts/0-create-cert.sh @@ -2,12 +2,6 @@ set -e -# Wait for haproxy container -while ! nc -z haproxy 9999 2>/dev/null; do - echo "Waiting for haproxy:9999..." - sleep 7 -done - if [ ! -f /etc/certificates/site.pem ]; then # Generate self-signed certificate openssl genrsa -out site.key 2048 @@ -16,6 +10,12 @@ if [ ! -f /etc/certificates/site.pem ]; then cat site.key site.crt >> /etc/certificates/site.pem fi +# Wait for haproxy container +while ! nc -z haproxy 9999 2>/dev/null; do + echo "Waiting for haproxy:9999..." + sleep 7 +done + # check e-mail for letsencrypt notifications if [ -n "$CERTBOT_EMAIL" ]; then CERTBOT_OPTS="--email $CERTBOT_EMAIL"