File size: 846 Bytes
85fd14e
 
 
fb08506
85fd14e
5e84499
85fd14e
 
 
 
fb08506
 
85fd14e
dcb3295
fb08506
dcb3295
 
fb08506
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

# Start Flask backend using Gunicorn in the background
# Your main.py is at the root, so reference it correctly as `main:app`.
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 foreground, listening on the public port (7860).
# Remove --server.enableCORS false if not strictly needed, but keep --server.enableXsrfProtection false for file uploads.
echo "Starting Streamlit frontend..."
streamlit run streamlit_app.py \
  --server.port 7860 \
  --server.enableCORS false \
  --server.enableXsrfProtection false \
  --server.fileWatcherType none
# Note: Streamlit is run in the foreground so it becomes the primary process for the container.