1
0
mirror of https://github.com/wmnnd/nginx-certbot synced 2023-04-20 18:47:46 +08:00

Firstly: generate dummy self-signed certs for ALL domains and only then start nginx

This commit is contained in:
Yaroslav 2018-11-29 18:37:17 +04:00
parent 6e3f21d4b0
commit d3485b19bb

View File

@ -40,6 +40,17 @@ for domain in "${domains[@]}"; do
done
for domain in "${domains[@]}"; do
echo "### Creating dummy certificate for $domain domain..."
path="/etc/letsencrypt/live/$domain"
docker-compose run --rm --entrypoint "openssl req -x509 -nodes -newkey rsa:4096 \
-days 10 -keyout '$path/privkey.pem' -out '$path/fullchain.pem' -subj '/CN=localhost'" certbot
done
echo "### Starting nginx ..."
docker-compose up -d nginx
# Select appropriate email arg
case "$email" in
"") email_arg="--register-unsafely-without-email" ;;
@ -50,15 +61,6 @@ esac
if [ $staging != "0" ]; then staging_arg="--staging"; fi
for domain in "${domains[@]}"; do
echo "### Creating dummy certificate for $domain domain..."
path="/etc/letsencrypt/live/$domain"
docker-compose run --rm --entrypoint "openssl req -x509 -nodes -newkey rsa:4096 \
-days 10 -keyout '$path/privkey.pem' -out '$path/fullchain.pem' -subj '/CN=localhost'" certbot
echo "### Starting nginx ..."
docker-compose up -d nginx
echo "### Deleting dummy certificate for $domain domain ..."
rm -rf "$data_path/conf/live/$domain"