File size: 843 Bytes
f59c380
ef5b841
f59c380
00c66be
 
 
 
 
 
 
 
 
 
 
3bce16c
 
00c66be
 
3bce16c
 
 
00c66be
3bce16c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Trigger build: 2026-05-07 09:07

echo "--- STARTUP DEBUG INFO ---"
echo "SERVICE_TYPE is: '$SERVICE_TYPE'"
echo "PROD_BACKEND is: '$PROD_BACKEND'"
echo "--------------------------"

if [ "$SERVICE_TYPE" = "backend" ] || [ "$PROD_BACKEND" = "true" ]; then
    echo "!!! CRITICAL: FORCING BACKEND-ONLY MODE !!!"
    # Kill any accidental Nginx/Node processes
    pkill nginx || true
    pkill node || true
    # Start ONLY uvicorn on the primary HF port
    cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 7860
else
    echo "!!! STARTING FULL-STACK INTERFACE !!!"
    # Internal ports: Backend(8000), Frontend(3000)
    cd /app/backend && uvicorn app.main:app --host 0.0.0.0 --port 8000 &
    cd /app/frontend && npm run start -- -p 3000 &
    
    # Nginx as public entry point (7860)
    nginx -g "daemon off;"
fi