Mars203020 commited on
Commit
5a90920
·
verified ·
1 Parent(s): 92d12b6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -4,13 +4,15 @@ FROM python:3.11
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Environment variables (use port 7860 for HF Spaces)
8
  ENV PYTHONDONTWRITEBYTECODE=1 \
9
  PYTHONUNBUFFERED=1 \
10
- STREAMLIT_SERVER_PORT=7860 \
11
  STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
12
  STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \
13
- STREAMLIT_SERVER_HEADLESS=true
 
 
14
 
15
  # Install system dependencies (HF-safe)
16
  RUN apt-get update --fix-missing && \
@@ -54,8 +56,8 @@ COPY .streamlit/config.toml .streamlit/config.toml
54
  RUN useradd -m appuser
55
  USER appuser
56
 
57
- # Expose Streamlit port (7860 for HF Spaces)
58
- EXPOSE 7860
59
 
60
- # Run Streamlit
61
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Environment variables (use port 8501 for Streamlit on HF Spaces)
8
  ENV PYTHONDONTWRITEBYTECODE=1 \
9
  PYTHONUNBUFFERED=1 \
10
+ STREAMLIT_SERVER_PORT=8501 \
11
  STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
12
  STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \
13
+ STREAMLIT_SERVER_HEADLESS=true \
14
+ STREAMLIT_SERVER_FILE_WATCHER_TYPE=none \
15
+ STREAMLIT_SERVER_RUN_ON_SAVE=false
16
 
17
  # Install system dependencies (HF-safe)
18
  RUN apt-get update --fix-missing && \
 
56
  RUN useradd -m appuser
57
  USER appuser
58
 
59
+ # Expose Streamlit default port
60
+ EXPOSE 8501
61
 
62
+ # Run Streamlit (disable file watcher to prevent restart loops)
63
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.fileWatcherType=none"]