#!/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