mirror of
https://github.com/TeamPiped/Piped-Docker.git
synced 2025-01-06 01:20:38 +05:30
Add handling of custom ports (might not work for caddy)
This commit is contained in:
parent
49b98cbeb3
commit
d3a3225ea7
@ -3,6 +3,7 @@ echo "Enter a hostname for the Frontend (eg: piped.kavin.rocks):" && read -r fro
|
|||||||
echo "Enter a hostname for the Backend (eg: pipedapi.kavin.rocks):" && read -r backend
|
echo "Enter a hostname for the Backend (eg: pipedapi.kavin.rocks):" && read -r backend
|
||||||
echo "Enter a hostname for the Proxy (eg: pipedproxy.kavin.rocks):" && read -r proxy
|
echo "Enter a hostname for the Proxy (eg: pipedproxy.kavin.rocks):" && read -r proxy
|
||||||
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
|
||||||
|
echo "Enter a port to use for the reverse proxy:" && read -r port
|
||||||
|
|
||||||
rm -rf config/
|
rm -rf config/
|
||||||
rm -f docker-compose.yml
|
rm -f docker-compose.yml
|
||||||
@ -12,5 +13,6 @@ cp -r template/ config/
|
|||||||
sed -i "s/FRONTEND_HOSTNAME/$frontend/g" config/*
|
sed -i "s/FRONTEND_HOSTNAME/$frontend/g" config/*
|
||||||
sed -i "s/BACKEND_HOSTNAME/$backend/g" config/*
|
sed -i "s/BACKEND_HOSTNAME/$backend/g" config/*
|
||||||
sed -i "s/PROXY_HOSTNAME/$proxy/g" config/*
|
sed -i "s/PROXY_HOSTNAME/$proxy/g" config/*
|
||||||
|
sed -i "s/PORT_VALUE/$port/g" config/*
|
||||||
|
|
||||||
mv config/docker-compose.$reverseproxy.yml docker-compose.yml
|
mv config/docker-compose.$reverseproxy.yml docker-compose.yml
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# The port to Listen on.
|
# The port to Listen on.
|
||||||
PORT: 8080
|
PORT: PORT_VALUE
|
||||||
|
|
||||||
# The number of workers to use for the server
|
# The number of workers to use for the server
|
||||||
HTTP_WORKERS: 2
|
HTTP_WORKERS: 2
|
||||||
|
@ -24,6 +24,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
container_name: piped-backend
|
container_name: piped-backend
|
||||||
|
environment:
|
||||||
|
- PORT=PORT_VALUE
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:mainline-alpine
|
image: nginx:mainline-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@ -31,13 +33,15 @@ services:
|
|||||||
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
|
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
- ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
|
- ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
|
||||||
container_name: nginx
|
container_name: nginx
|
||||||
|
environment:
|
||||||
|
- PORT=PORT_VALUE
|
||||||
depends_on:
|
depends_on:
|
||||||
- piped
|
- piped
|
||||||
caddy:
|
caddy:
|
||||||
image: caddy:2-alpine
|
image: caddy:2-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "PORT_VALUE:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
- "443:443/udp"
|
- "443:443/udp"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -24,11 +24,13 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
container_name: piped-backend
|
container_name: piped-backend
|
||||||
|
environment:
|
||||||
|
- PORT=PORT_VALUE
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:mainline-alpine
|
image: nginx:mainline-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "PORT_VALUE:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
|
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
- ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
|
- ./config/pipedapi.conf:/etc/nginx/conf.d/pipedapi.conf:ro
|
||||||
@ -45,7 +47,10 @@ services:
|
|||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.piped.rule=Host(`FRONTEND_HOSTNAME`, `BACKEND_HOSTNAME`, `PROXY_HOSTNAME`)"
|
- "traefik.http.routers.piped.rule=Host(`FRONTEND_HOSTNAME`, `BACKEND_HOSTNAME`, `PROXY_HOSTNAME`)"
|
||||||
- "traefik.http.routers.piped.entrypoints=websecure"
|
- "traefik.http.routers.piped.entrypoints=websecure"
|
||||||
- "traefik.http.services.piped.loadbalancer.server.port=8080"
|
- "traefik.http.services.piped.loadbalancer.server.port=PORT_VALUE"
|
||||||
|
environment:
|
||||||
|
- PORT=PORT_VALUE
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -4,7 +4,7 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name BACKEND_HOSTNAME;
|
server_name BACKEND_HOSTNAME;
|
||||||
|
|
||||||
set $backend "http://piped:8080";
|
set $backend "http://piped:PORT_VALUE";
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_cache pipedapi;
|
proxy_cache pipedapi;
|
||||||
|
Loading…
Reference in New Issue
Block a user