MediVision / src /start_app.sh
Boghdady9
πŸ”§ Add debugging and error handling for Gradio startup
d6145e3
#!/bin/bash
echo "===== Application Startup at $(date) ====="
echo ""
echo "πŸ”¬ MediVision - AI-Powered Radiology Report System"
echo "=================================================="
# Check current directory and list files
echo "πŸ“‚ Current directory: $(pwd)"
echo "πŸ“ Available files:"
ls -la /app/
# Check if argument provided
if [ "$1" = "streamlit" ]; then
echo "🌐 Starting with Streamlit..."
cd /app/backend && uvicorn service:app --host 0.0.0.0 --port 8001 &
BACKEND_PID=$!
echo "πŸ”§ Backend started with PID: $BACKEND_PID"
sleep 2
cd /app && streamlit run streamlit_app.py --server.port 8501 --server.address 0.0.0.0 --server.enableXsrfProtection=false
elif [ "$1" = "gradio" ]; then
echo "🌐 Starting with Gradio..."
cd /app/backend && uvicorn service:app --host 0.0.0.0 --port 8001 &
BACKEND_PID=$!
echo "πŸ”§ Backend started with PID: $BACKEND_PID"
sleep 3
echo "πŸš€ Starting Gradio frontend..."
cd /app && python gradio_app.py
else
echo "🌐 Starting with Gradio (default)..."
cd /app/backend && uvicorn service:app --host 0.0.0.0 --port 8001 &
BACKEND_PID=$!
echo "πŸ”§ Backend started with PID: $BACKEND_PID"
sleep 3
echo "πŸš€ Starting Gradio frontend..."
cd /app
echo "πŸ“ About to run: python gradio_app.py"
echo "πŸ“ Files in current directory:"
ls -la
python gradio_app.py
fi