dashboard / start.sh
timchen0618
Deploy research dashboard
b03f016
raw
history blame contribute delete
605 Bytes
#!/bin/bash
set -e
echo "===== Application Startup at $(date -u +%Y-%m-%dT%H:%M:%S) ====="
# Start Flask backend in background
echo "Starting Flask backend..."
cd /app
gunicorn --bind 127.0.0.1:5000 --workers 1 --timeout 120 backend.app:app &
BACKEND_PID=$!
# Wait for backend to be ready
echo "Waiting for backend to start..."
for i in $(seq 1 10); do
if curl -s http://127.0.0.1:5000/api/health > /dev/null 2>&1; then
echo "Backend is ready (attempt $i)"
break
fi
sleep 1
done
# Start nginx in foreground
echo "Starting nginx on port 7860..."
exec nginx -g 'daemon off;'