Spaces:
Sleeping
Sleeping
File size: 898 Bytes
85fd14e dcb3295 85fd14e 5e84499 85fd14e dcb3295 85fd14e dcb3295 85fd14e | 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
# Start Flask backend using Gunicorn in the background
# Your main.py is at the root, so reference it correctly.
echo "Starting Flask backend..."
gunicorn main:app --workers 1 --bind 0.0.0.0:5000 --timeout 600 --log-level debug &
# Wait a bit for Flask to start (optional, but can help prevent connection errors)
sleep 5
# Start Streamlit frontend in the background
# Ensure these flags are set for Streamlit to handle file uploads correctly in a proxied environment.
echo "Starting Streamlit frontend..."
streamlit run streamlit_app.py \
--server.port 8501 \
--server.enableCORS false \
--server.enableXsrfProtection false \
--server.fileWatcherType none & # Keep this for faster restarts if you have it
# Wait a bit for Streamlit to start (optional)
sleep 5
# Start Nginx in the foreground (important for Docker containers)
echo "Starting Nginx..."
nginx -g "daemon off;" |