refactor: use env variables to configure frontend

This commit is contained in:
Bnyro
2024-06-16 12:26:15 +02:00
parent 72d073f5b8
commit df490d3f20
2 changed files with 9 additions and 9 deletions
+5 -5
View File
@@ -1,18 +1,18 @@
version: '3'
services:
hyperpipe-frontend:
image: codeberg.org/hyperpipe/hyperpipe:latest
container_name: hyperpipe-frontend
environment:
- HYP_API=HYPERPIPE_API_URL
- PIPED_API=PIPED_API_URL
restart: unless-stopped
entrypoint: sh -c 'find /usr/share/nginx/html -type f -exec sed -i s/pipedapi.kavin.rocks/PIPED/g {} \; -exec sed -i s/hyperpipeapi.onrender.com/BACKEND/g {} \; && /docker-entrypoint.sh && nginx -g "daemon off;"'
ports:
- '8080:80'
hyperpipe-backend:
image: codeberg.org/hyperpipe/hyperpipe-backend:latest
container_name: hyperpipe-backend
environment:
- HYP_PROXY=hyperpipe-proxy.onrender.com
- HYP_PROXY=PIPED_PROXY_URL
restart: unless-stopped
ports:
- '3000:3000'
@@ -26,4 +26,4 @@ services:
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_INCLUDE_RESTARTING=true
command: hyperpipe-frontend hyperpipe-backend watchtower
command: hyperpipe-frontend hyperpipe-backend watchtower
+4 -4
View File
@@ -18,10 +18,10 @@ rm -f "*/docker-compose.yml"
cp docker-compose.template.yml docker-compose.yml
sed -i "s/hyperpipe-proxy.onrender.com/$proxy/g" docker-compose.yml
sed -i "s/PIPED_PROXY_URL/$proxy/g" docker-compose.yml
sed -i "s/PIPED/$piped/g" docker-compose.yml
sed -i "s/PIPED_API_URL/$piped/g" docker-compose.yml
sed -i "s/BACKEND/$backend/g" docker-compose.yml
sed -i "s/HYPERPIPE_API_URL/$backend/g" docker-compose.yml
printf '\nDone!\n'
printf '\nDone!\n'