Realtive URL fix

This commit is contained in:
James Pattinson
2025-12-10 10:10:13 +00:00
parent 39d5c2c9e2
commit 11f7390694
4 changed files with 34 additions and 32 deletions

View File

@@ -7,7 +7,6 @@ services:
# FastAPI Backend
api:
build: ./backend
container_name: ppr_prod_api
restart: always
environment:
DB_HOST: ${DB_HOST}
@@ -56,7 +55,6 @@ services:
# Redis for caching (optional)
redis:
image: redis:7-alpine
container_name: ppr_prod_redis
restart: always
networks:
- app_network
@@ -69,15 +67,11 @@ services:
# Nginx web server for public frontend
web:
image: nginx:alpine
container_name: ppr_prod_web
restart: always
environment:
BASE_URL: ${BASE_URL}
command: >
sh -c "cp /usr/share/nginx/html/ppr.html /tmp/ppr.html.orig &&
sed 's|__BASE_URL__|'"\$BASE_URL"'|g' /tmp/ppr.html.orig > /usr/share/nginx/html/ppr.html &&
cp /usr/share/nginx/html/index.html /tmp/index.html.orig &&
sed 's|__BASE_URL__|'"\$BASE_URL"'|g' /tmp/index.html.orig > /usr/share/nginx/html/index.html &&
sh -c "echo 'window.PPR_CONFIG = { apiBase: \"'\$BASE_URL'/api/v1\" };' > /usr/share/nginx/html/config.js &&
nginx -g 'daemon off;'"
ports:
- "${WEB_PORT_EXTERNAL}:80"