CausalBox / start.sh
Arya Patil
Initial deployment of CausalBox app
85fd14e
raw
history blame
1.05 kB
#!/bin/bash
# Start Flask backend using Gunicorn in the background
# Make sure main.py is in flask_backend/ and you reference it correctly.
# The `wsgi:app` assumes your Flask app instance is named `app` in `wsgi.py` (common Gunicorn setup)
# or you can point directly to `main:app` if `app` is defined in main.py.
# Based on your main.py, it's `main:app`.
echo "Starting Flask backend..."
gunicorn flask_backend.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
# Make sure streamlit_app.py is in streamlit_frontend/
echo "Starting Streamlit frontend..."
streamlit run streamlit_frontend/streamlit_app.py --server.port 8501 --server.enableCORS false --server.enableXsrfProtection false --server.fileWatcherType none &
# 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;"