1
0
mirror of https://github.com/ArcticFoxes-net/Signal-TLS-Proxy synced 2024-11-18 01:41:34 -05:00

Support Docker Compose v2 (#2)

This commit adds detection for Docker Compose v2 (a.k.a. `docker-compose-plugin`) and uses
the proper command (either `docker-compose` or `docker compose`) to run the containers.

Co-authored-by: Michael Baudino <michael@baudi.no>
This commit is contained in:
Tommy 2022-11-20 04:45:54 -05:00 committed by GitHub
parent 487810f259
commit de258d0ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,11 @@
#!/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 DOCKER_COMPOSE_CMD="docker-compose"
elif docker compose version; then
DOCKER_COMPOSE_CMD="docker compose"
else
echo 'Error: neither docker-compose (v1) nor docker-compose-plugin (v2) is installed.' >&2
exit 1 exit 1
fi fi
@ -32,7 +36,7 @@ for domain in "${domains[@]}"; do
domain_args="$domain_args -d $domain" domain_args="$domain_args -d $domain"
done done
docker-compose run -p 80:80 --rm --entrypoint "\ ${DOCKER_COMPOSE_CMD} run -p 80:80 --rm --entrypoint "\
sh -c \"certbot certonly --standalone \ sh -c \"certbot certonly --standalone \
--register-unsafely-without-email \ --register-unsafely-without-email \
$domain_args \ $domain_args \
@ -40,4 +44,4 @@ docker-compose run -p 80:80 --rm --entrypoint "\
--force-renewal && \ --force-renewal && \
ln -fs /etc/letsencrypt/live/$domains/ /etc/letsencrypt/active\"" certbot ln -fs /etc/letsencrypt/live/$domains/ /etc/letsencrypt/active\"" certbot
echo echo
echo "After running 'docker-compose up --detach' you can share your proxy as: https://signal.tube/#$domains" echo "After running '${DOCKER_COMPOSE_CMD} up --detach' you can share your proxy as: https://signal.tube/#$domains"