Spaces:
Sleeping
Sleeping
Update start.sh
Browse files
start.sh
CHANGED
@@ -1,25 +1,19 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Start Flask backend using Gunicorn in the background
|
4 |
-
# Your main.py is at the root, so reference it correctly
|
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
|
12 |
-
#
|
13 |
echo "Starting Streamlit frontend..."
|
14 |
streamlit run streamlit_app.py \
|
15 |
-
--server.port
|
16 |
--server.enableCORS false \
|
17 |
--server.enableXsrfProtection false \
|
18 |
-
--server.fileWatcherType none
|
19 |
-
|
20 |
-
# Wait a bit for Streamlit to start (optional)
|
21 |
-
sleep 5
|
22 |
-
|
23 |
-
# Start Nginx in the foreground (important for Docker containers)
|
24 |
-
echo "Starting Nginx..."
|
25 |
-
nginx -g "daemon off;"
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Start Flask backend using Gunicorn in the background
|
4 |
+
# Your main.py is at the root, so reference it correctly as `main:app`.
|
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 foreground, listening on the public port (7860).
|
12 |
+
# Remove --server.enableCORS false if not strictly needed, but keep --server.enableXsrfProtection false for file uploads.
|
13 |
echo "Starting Streamlit frontend..."
|
14 |
streamlit run streamlit_app.py \
|
15 |
+
--server.port 7860 \
|
16 |
--server.enableCORS false \
|
17 |
--server.enableXsrfProtection false \
|
18 |
+
--server.fileWatcherType none
|
19 |
+
# Note: Streamlit is run in the foreground so it becomes the primary process for the container.
|
|
|
|
|
|
|
|
|
|
|
|