Remove docker-compose version checks.

This commit is contained in:
Kavin 2022-06-02 04:38:55 +01:00 committed by Andrea Spacca
parent 83855ee276
commit 92c41f2465
3 changed files with 23 additions and 31 deletions

View file

@ -1,24 +1,6 @@
# Check if Docker-Compose is not installed
if [ -z "$(which docker-compose)" ]; then
echo "Docker-Compose is not installed. Please install it first from https://docs.docker.com/compose/install/#install-compose."
exit 1
fi
# Docker-Compose version check, to prevent "Unsupported configuration option"
COMPOSE_VERSION=$(docker-compose version --short 2>/dev/null || docker compose version --short 2>/dev/null)
REQUIRED_COMPOSE_VERSION="1.28.0"
if [[ $(printf '%s\n' "$REQUIRED_COMPOSE_VERSION" "$COMPOSE_VERSION" | sort -V | head -n1) != $REQUIRED_COMPOSE_VERSION ]]; then
echo "Your docker-compose version of $COMPOSE_VERSION is too old. Please upgrade to $REQUIRED_COMPOSE_VERSION or higher."
echo "See https://docs.docker.com/compose/install/#install-compose for installation instructions."
exit 1
fi
echo "Enter an url for the Frontend (eg: https://piped.kavin.rocks):" && read -r frontend_url
echo "Enter an url for the Backend (eg: https://pipedapi.kavin.rocks):" && read -r backend_url
echo "Enter an hostname for the Proxy (eg: https://pipedproxy.kavin.rocks):" && read -r proxy_url
echo "Enter an url for the Frontend (eg: https://piped.kavin.rocks):" && read -r frontend
echo "Enter an url for the Backend (eg: https://pipedapi.kavin.rocks):" && read -r backend
echo "Enter an hostname for the Proxy (eg: https://pipedproxy.kavin.rocks):" && read -r proxy
echo "Enter the reverse proxy you would like to use (either caddy or nginx):" && read -r reverseproxy
rm -rf config/
@ -26,10 +8,18 @@ rm -f docker-compose.yml
cp -r template/ config/
frontend_schema=$(echo "$frontend_url"| awk -F[/:] '{print $1}')
backend_schema=$(echo "$backend_url"| awk -F[/:] '{print $1}')
proxy_schema=$(echo "$proxy_url"| awk -F[/:] '{print $1}')
frontend_hostname=$(echo "$frontend_url"| awk -F[/:] '{print $4}')
backend_hostname=$(echo "$backend_url"| awk -F[/:] '{print $4}')
proxy_hostname=$(echo "$proxy_url"| awk -F[/:] '{print $4}')
frontend_port=$(echo "$frontend_url"| awk -F[/:] '{print $5}'| { read -d '' port; [ -z "$port" ] && { [ "$frontend_schema" = "https" ] && echo "443" || echo "80"; } || echo "$port"; })
backend_port=$(echo "$backend_url"| awk -F[/:] '{print $5}'| { read -d '' port; [ -z "$port" ] && { [ "$backend_schema" = "https" ] && echo "443" || echo "80"; } || echo "$port"; })
proxy_port=$(echo "$proxy_url"| awk -F[/:] '{print $5}'| { read -d '' port; [ -z "$port" ] && { [ "$proxy_schema" = "https" ] && echo "443" || echo "80"; } || echo "$port"; })
sed -i "s@FRONT_URL@$frontend_url@g" config/*
sed -i "s@BACKEND_URL@$backend_url@g" config/*
sed -i "s@PROXY_URL@$proxy_url@g" config/*
@ -38,6 +28,10 @@ sed -i "s@FRONTEND_HOSTNAME@$frontend_hostname@g" config/*
sed -i "s@BACKEND_HOSTNAME@$backend_hostname@g" config/*
sed -i "s@PROXY_HOSTNAME@$proxy_hostname@g" config/*
sed -i "s@FRONTEND_PORT@$frontend_port@g" config/*
sed -i "s@BACKEND_PORT@$backend_port@g" config/*
sed -i "s@PROXY_PORT@$proxy_port@g" config/*
# The openj9 image does not support aarch64
if [[ "$(uname -m)" == "aarch64" ]]; then
sed -i "s/piped:latest/piped:hotspot/g" config/*

View file

@ -1,3 +1,5 @@
version: "3"
services:
pipedfrontend:
image: 1337kavin/piped-frontend:latest
@ -5,9 +7,7 @@ services:
depends_on:
- piped
container_name: piped-frontend
entrypoint: ash -c 'sed -i s@https://pipedapi.kavin.rocks@BACKEND_URL@g
/usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g
"daemon off;"'
entrypoint: ash -c 'sed -i s@https://pipedapi.kavin.rocks@BACKEND_URL@g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g "daemon off;"'
ytproxy:
image: 1337kavin/ytproxy:latest
restart: unless-stopped
@ -31,8 +31,7 @@ services:
depends_on:
- piped
healthcheck:
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed ||
(varnishreload && exit 1)"
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || (varnishreload && exit 1)"
interval: 10s
timeout: 10s
retries: 1

View file

@ -1,3 +1,5 @@
version: "3"
services:
pipedfrontend:
image: 1337kavin/piped-frontend:latest
@ -5,9 +7,7 @@ services:
depends_on:
- piped
container_name: piped-frontend
entrypoint: ash -c 'sed -i s@https://pipedapi.kavin.rocks@BACKEND_URL@g
/usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g
"daemon off;"'
entrypoint: ash -c 'sed -i s@https://pipedapi.kavin.rocks@BACKEND_URL@g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g "daemon off;"'
ytproxy:
image: 1337kavin/ytproxy:latest
restart: unless-stopped
@ -31,8 +31,7 @@ services:
depends_on:
- piped
healthcheck:
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed ||
(varnishreload && exit 1)"
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || (varnishreload && exit 1)"
interval: 10s
timeout: 10s
retries: 1