Commit Β·
3aa5a30
1
Parent(s): 7856594
fix: change Streamlit port to 7860 for HuggingFace Docker Spaces
Browse files- Dockerfile +14 -14
Dockerfile
CHANGED
|
@@ -26,8 +26,8 @@ COPY . .
|
|
| 26 |
# Create data directories
|
| 27 |
RUN mkdir -p data chroma_db logs
|
| 28 |
|
| 29 |
-
# Expose ports for backend (8000) and frontend (
|
| 30 |
-
EXPOSE
|
| 31 |
|
| 32 |
# Set environment to use Hugging Face
|
| 33 |
ENV LLM_PROVIDER=huggingface
|
|
@@ -76,25 +76,25 @@ RUN echo '#!/bin/bash\n\
|
|
| 76 |
# Test critical imports before launching Streamlit\n\
|
| 77 |
echo "Testing Python imports..." \n\
|
| 78 |
python3 -c "\n\
|
| 79 |
-
import sys\n\
|
| 80 |
-
try:\n\
|
| 81 |
import streamlit; print(\" β
streamlit\")\n\
|
| 82 |
-
except Exception as e: print(f\" β streamlit: {e}\"); sys.exit(1)\n\
|
| 83 |
-
try:\n\
|
| 84 |
import requests; print(\" β
requests\")\n\
|
| 85 |
-
except Exception as e: print(f\" β requests: {e}\")\n\
|
| 86 |
-
try:\n\
|
| 87 |
from streamlit_calendar import calendar; print(\" β
streamlit_calendar\")\n\
|
| 88 |
-
except Exception as e: print(f\" β streamlit_calendar: {e}\")\n\
|
| 89 |
-
try:\n\
|
| 90 |
import firebase_admin; print(\" β
firebase_admin\")\n\
|
| 91 |
-
except Exception as e: print(f\" β firebase_admin: {e}\")\n\
|
| 92 |
-
print(\"Import check complete.\")\n\
|
| 93 |
"\n\
|
| 94 |
\n\
|
| 95 |
# Start Streamlit frontend\n\
|
| 96 |
-
echo "Starting frontend on port
|
| 97 |
-
exec streamlit run app.py --server.port
|
| 98 |
' > /app/start.sh && chmod +x /app/start.sh
|
| 99 |
|
| 100 |
# Run startup script
|
|
|
|
| 26 |
# Create data directories
|
| 27 |
RUN mkdir -p data chroma_db logs
|
| 28 |
|
| 29 |
+
# Expose ports for backend (8000) and frontend (7860 = HF Spaces default)
|
| 30 |
+
EXPOSE 7860 8000
|
| 31 |
|
| 32 |
# Set environment to use Hugging Face
|
| 33 |
ENV LLM_PROVIDER=huggingface
|
|
|
|
| 76 |
# Test critical imports before launching Streamlit\n\
|
| 77 |
echo "Testing Python imports..." \n\
|
| 78 |
python3 -c "\n\
|
| 79 |
+
import sys\n\
|
| 80 |
+
try:\n\
|
| 81 |
import streamlit; print(\" β
streamlit\")\n\
|
| 82 |
+
except Exception as e: print(f\" β streamlit: {e}\"); sys.exit(1)\n\
|
| 83 |
+
try:\n\
|
| 84 |
import requests; print(\" β
requests\")\n\
|
| 85 |
+
except Exception as e: print(f\" β requests: {e}\")\n\
|
| 86 |
+
try:\n\
|
| 87 |
from streamlit_calendar import calendar; print(\" β
streamlit_calendar\")\n\
|
| 88 |
+
except Exception as e: print(f\" β streamlit_calendar: {e}\")\n\
|
| 89 |
+
try:\n\
|
| 90 |
import firebase_admin; print(\" β
firebase_admin\")\n\
|
| 91 |
+
except Exception as e: print(f\" β firebase_admin: {e}\")\n\
|
| 92 |
+
print(\"Import check complete.\")\n\
|
| 93 |
"\n\
|
| 94 |
\n\
|
| 95 |
# Start Streamlit frontend\n\
|
| 96 |
+
echo "Starting frontend on port 7860..." \n\
|
| 97 |
+
exec streamlit run app.py --server.port 7860 --server.address 0.0.0.0 --server.headless true 2>&1\n\
|
| 98 |
' > /app/start.sh && chmod +x /app/start.sh
|
| 99 |
|
| 100 |
# Run startup script
|