Firstly: generate dummy self-signed certs for ALL domains and only then start nginx
This commit is contained in:
parent
6e3f21d4b0
commit
d3485b19bb
20
certbot.sh
20
certbot.sh
|
@ -40,6 +40,17 @@ for domain in "${domains[@]}"; do
|
||||||
done
|
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
|
# Select appropriate email arg
|
||||||
case "$email" in
|
case "$email" in
|
||||||
"") email_arg="--register-unsafely-without-email" ;;
|
"") email_arg="--register-unsafely-without-email" ;;
|
||||||
|
@ -50,15 +61,6 @@ esac
|
||||||
if [ $staging != "0" ]; then staging_arg="--staging"; fi
|
if [ $staging != "0" ]; then staging_arg="--staging"; fi
|
||||||
|
|
||||||
for domain in "${domains[@]}"; do
|
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 ..."
|
echo "### Deleting dummy certificate for $domain domain ..."
|
||||||
rm -rf "$data_path/conf/live/$domain"
|
rm -rf "$data_path/conf/live/$domain"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue