Spaces:
Sleeping
Sleeping
Update start.sh
Browse files
start.sh
CHANGED
|
@@ -1,20 +1,17 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
# Start Flask backend using Gunicorn in the background
|
| 4 |
-
#
|
| 5 |
-
# The `wsgi:app` assumes your Flask app instance is named `app` in `wsgi.py` (common Gunicorn setup)
|
| 6 |
-
# or you can point directly to `main:app` if `app` is defined in main.py.
|
| 7 |
-
# Based on your main.py, it's `main:app`.
|
| 8 |
echo "Starting Flask backend..."
|
| 9 |
-
gunicorn
|
| 10 |
|
| 11 |
# Wait a bit for Flask to start (optional, but can help prevent connection errors)
|
| 12 |
sleep 5
|
| 13 |
|
| 14 |
# Start Streamlit frontend in the background
|
| 15 |
-
#
|
| 16 |
echo "Starting Streamlit frontend..."
|
| 17 |
-
streamlit run
|
| 18 |
|
| 19 |
# Wait a bit for Streamlit to start (optional)
|
| 20 |
sleep 5
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
# Start Flask backend using Gunicorn in the background
|
| 4 |
+
# Your main.py is at the root, so reference it directly.
|
|
|
|
|
|
|
|
|
|
| 5 |
echo "Starting Flask backend..."
|
| 6 |
+
gunicorn main:app --workers 1 --bind 0.0.0.0:5000 --timeout 600 --log-level debug &
|
| 7 |
|
| 8 |
# Wait a bit for Flask to start (optional, but can help prevent connection errors)
|
| 9 |
sleep 5
|
| 10 |
|
| 11 |
# Start Streamlit frontend in the background
|
| 12 |
+
# Your streamlit_app.py is at the root, so reference it directly.
|
| 13 |
echo "Starting Streamlit frontend..."
|
| 14 |
+
streamlit run streamlit_app.py --server.port 8501 --server.enableCORS false --server.enableXsrfProtection false --server.fileWatcherType none &
|
| 15 |
|
| 16 |
# Wait a bit for Streamlit to start (optional)
|
| 17 |
sleep 5
|