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