not the old docker-compose.
This commit is contained in:
parent
92592fbfa5
commit
5e13a02ebd
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if ! [ -x "$(command -v docker-compose)" ]; then
|
if ! [ -x "$(command -v docker compose)" ]; then
|
||||||
echo 'Error: docker-compose is not installed.' >&2
|
echo 'Error: docker compose is not installed.' >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ fi
|
||||||
echo "### Creating dummy certificate for $domains ..."
|
echo "### Creating dummy certificate for $domains ..."
|
||||||
path="/etc/letsencrypt/live/$domains"
|
path="/etc/letsencrypt/live/$domains"
|
||||||
mkdir -p "$data_path/conf/live/$domains"
|
mkdir -p "$data_path/conf/live/$domains"
|
||||||
docker-compose run --rm --entrypoint "\
|
docker compose run --rm --entrypoint "\
|
||||||
openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\
|
openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\
|
||||||
-keyout '$path/privkey.pem' \
|
-keyout '$path/privkey.pem' \
|
||||||
-out '$path/fullchain.pem' \
|
-out '$path/fullchain.pem' \
|
||||||
|
@ -39,11 +39,11 @@ echo
|
||||||
|
|
||||||
|
|
||||||
echo "### Starting nginx ..."
|
echo "### Starting nginx ..."
|
||||||
docker-compose up --force-recreate -d nginx
|
docker compose up --force-recreate -d nginx
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "### Deleting dummy certificate for $domains ..."
|
echo "### Deleting dummy certificate for $domains ..."
|
||||||
docker-compose run --rm --entrypoint "\
|
docker compose run --rm --entrypoint "\
|
||||||
rm -Rf /etc/letsencrypt/live/$domains && \
|
rm -Rf /etc/letsencrypt/live/$domains && \
|
||||||
rm -Rf /etc/letsencrypt/archive/$domains && \
|
rm -Rf /etc/letsencrypt/archive/$domains && \
|
||||||
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
|
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
|
||||||
|
@ -66,7 +66,7 @@ esac
|
||||||
# Enable staging mode if needed
|
# Enable staging mode if needed
|
||||||
if [ $staging != "0" ]; then staging_arg="--staging"; fi
|
if [ $staging != "0" ]; then staging_arg="--staging"; fi
|
||||||
|
|
||||||
docker-compose run --rm --entrypoint "\
|
docker compose run --rm --entrypoint "\
|
||||||
certbot certonly --webroot -w /var/www/certbot \
|
certbot certonly --webroot -w /var/www/certbot \
|
||||||
$staging_arg \
|
$staging_arg \
|
||||||
$email_arg \
|
$email_arg \
|
||||||
|
@ -77,4 +77,4 @@ docker-compose run --rm --entrypoint "\
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "### Reloading nginx ..."
|
echo "### Reloading nginx ..."
|
||||||
docker-compose exec nginx nginx -s reload
|
docker compose exec nginx nginx -s reload
|
||||||
|
|
Loading…
Reference in New Issue