Álvaro Valenzuela Valdes commited on
Commit
00c66be
·
1 Parent(s): 3bce16c

fix: hardened backend isolation and debug logs in start.sh

Browse files
Files changed (1) hide show
  1. start.sh +15 -9
start.sh CHANGED
@@ -1,18 +1,24 @@
1
  #!/bin/bash
2
- # Trigger build: 2026-05-07 08:49
3
 
4
- if [ "$SERVICE_TYPE" = "backend" ]; then
5
- echo "!!! STARTING IN BACKEND-ONLY MODE !!!"
 
 
 
 
 
 
 
 
 
6
  cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 7860
7
  else
8
- echo "!!! STARTING IN FULL-STACK MODE !!!"
9
- # Start Backend on internal port
10
  cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 &
11
-
12
- # Start Frontend on internal port
13
  cd /app/frontend && npm run start -- -p 3000 &
14
 
15
- # Start Nginx as the main entry point on HF port 7860
16
- echo "Starting Nginx Proxy..."
17
  nginx -g "daemon off;"
18
  fi
 
1
  #!/bin/bash
2
+ # Trigger build: 2026-05-07 08:52
3
 
4
+ echo "--- STARTUP DEBUG INFO ---"
5
+ echo "SERVICE_TYPE is: '$SERVICE_TYPE'"
6
+ echo "PROD_BACKEND is: '$PROD_BACKEND'"
7
+ echo "--------------------------"
8
+
9
+ if [ "$SERVICE_TYPE" = "backend" ] || [ "$PROD_BACKEND" = "true" ]; then
10
+ echo "!!! CRITICAL: FORCING BACKEND-ONLY MODE !!!"
11
+ # Kill any accidental Nginx/Node processes
12
+ pkill nginx || true
13
+ pkill node || true
14
+ # Start ONLY uvicorn on the primary HF port
15
  cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 7860
16
  else
17
+ echo "!!! STARTING FULL-STACK INTERFACE !!!"
18
+ # Internal ports: Backend(8000), Frontend(3000)
19
  cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 &
 
 
20
  cd /app/frontend && npm run start -- -p 3000 &
21
 
22
+ # Nginx as public entry point (7860)
 
23
  nginx -g "daemon off;"
24
  fi