SivaRohith69 commited on
Commit
3aa5a30
Β·
1 Parent(s): 7856594

fix: change Streamlit port to 7860 for HuggingFace Docker Spaces

Browse files
Files changed (1) hide show
  1. 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 (8501)
30
- EXPOSE 8501 8000
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 8501..." \n\
97
- exec streamlit run app.py --server.port 8501 --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
 
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