mirror of
https://github.com/TeamPiped/Piped-Docker.git
synced 2024-08-14 23:56:53 +00:00
Remove docker-compose version checks.
This commit is contained in:
parent
83855ee276
commit
92c41f2465
3 changed files with 23 additions and 31 deletions
|
@ -1,24 +1,6 @@
|
||||||
# Check if Docker-Compose is not installed
|
echo "Enter an url for the Frontend (eg: https://piped.kavin.rocks):" && read -r frontend
|
||||||
if [ -z "$(which docker-compose)" ]; then
|
echo "Enter an url for the Backend (eg: https://pipedapi.kavin.rocks):" && read -r backend
|
||||||
echo "Docker-Compose is not installed. Please install it first from https://docs.docker.com/compose/install/#install-compose."
|
echo "Enter an hostname for the Proxy (eg: https://pipedproxy.kavin.rocks):" && read -r proxy
|
||||||
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 the reverse proxy you would like to use (either caddy or nginx):" && read -r reverseproxy
|
echo "Enter the reverse proxy you would like to use (either caddy or nginx):" && read -r reverseproxy
|
||||||
|
|
||||||
rm -rf config/
|
rm -rf config/
|
||||||
|
@ -26,10 +8,18 @@ rm -f docker-compose.yml
|
||||||
|
|
||||||
cp -r template/ config/
|
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}')
|
frontend_hostname=$(echo "$frontend_url"| awk -F[/:] '{print $4}')
|
||||||
backend_hostname=$(echo "$backend_url"| awk -F[/:] '{print $4}')
|
backend_hostname=$(echo "$backend_url"| awk -F[/:] '{print $4}')
|
||||||
proxy_hostname=$(echo "$proxy_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@FRONT_URL@$frontend_url@g" config/*
|
||||||
sed -i "s@BACKEND_URL@$backend_url@g" config/*
|
sed -i "s@BACKEND_URL@$backend_url@g" config/*
|
||||||
sed -i "s@PROXY_URL@$proxy_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@BACKEND_HOSTNAME@$backend_hostname@g" config/*
|
||||||
sed -i "s@PROXY_HOSTNAME@$proxy_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
|
# The openj9 image does not support aarch64
|
||||||
if [[ "$(uname -m)" == "aarch64" ]]; then
|
if [[ "$(uname -m)" == "aarch64" ]]; then
|
||||||
sed -i "s/piped:latest/piped:hotspot/g" config/*
|
sed -i "s/piped:latest/piped:hotspot/g" config/*
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
pipedfrontend:
|
pipedfrontend:
|
||||||
image: 1337kavin/piped-frontend:latest
|
image: 1337kavin/piped-frontend:latest
|
||||||
|
@ -5,9 +7,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- piped
|
- piped
|
||||||
container_name: piped-frontend
|
container_name: piped-frontend
|
||||||
entrypoint: ash -c 'sed -i s@https://pipedapi.kavin.rocks@BACKEND_URL@g
|
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;"'
|
||||||
/usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g
|
|
||||||
"daemon off;"'
|
|
||||||
ytproxy:
|
ytproxy:
|
||||||
image: 1337kavin/ytproxy:latest
|
image: 1337kavin/ytproxy:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -31,8 +31,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- piped
|
- piped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed ||
|
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || (varnishreload && exit 1)"
|
||||||
(varnishreload && exit 1)"
|
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 1
|
retries: 1
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
pipedfrontend:
|
pipedfrontend:
|
||||||
image: 1337kavin/piped-frontend:latest
|
image: 1337kavin/piped-frontend:latest
|
||||||
|
@ -5,9 +7,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- piped
|
- piped
|
||||||
container_name: piped-frontend
|
container_name: piped-frontend
|
||||||
entrypoint: ash -c 'sed -i s@https://pipedapi.kavin.rocks@BACKEND_URL@g
|
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;"'
|
||||||
/usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g
|
|
||||||
"daemon off;"'
|
|
||||||
ytproxy:
|
ytproxy:
|
||||||
image: 1337kavin/ytproxy:latest
|
image: 1337kavin/ytproxy:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -31,8 +31,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- piped
|
- piped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed ||
|
test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || (varnishreload && exit 1)"
|
||||||
(varnishreload && exit 1)"
|
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 1
|
retries: 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue