toddmattingly commited on
Commit
cd7e430
·
verified ·
1 Parent(s): 395f04b

Update Dockerfile.txt

Browse files
Files changed (1) hide show
  1. Dockerfile.txt +6 -9
Dockerfile.txt CHANGED
@@ -1,26 +1,23 @@
1
- # ==== Base image ====
2
  FROM python:3.10-slim
3
 
4
- # ==== Set working directory ====
5
  WORKDIR /app
6
-
7
- # ==== Copy and install dependencies ====
8
  COPY requirements.txt .
9
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
10
 
11
- # ==== Copy all files into container ====
12
  COPY . .
13
 
14
- # ==== Streamlit configuration for HuggingFace ====
15
  ENV STREAMLIT_SERVER_HEADLESS=true
16
  ENV STREAMLIT_SERVER_ENABLECORS=false
17
  ENV STREAMLIT_SERVER_ENABLEXSRSFPROTECTION=false
18
  ENV STREAMLIT_SERVER_PORT=7860
19
  ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
 
20
 
21
- # ==== Expose Hugging Face port ====
22
  EXPOSE 7860
23
 
24
- # ==== Start Streamlit in headless mode ====
25
- ENTRYPOINT ["streamlit", "run", "app.py"]
 
 
26
 
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
 
 
4
  COPY requirements.txt .
5
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
6
 
 
7
  COPY . .
8
 
9
+ # --- Streamlit settings for Hugging Face ---
10
  ENV STREAMLIT_SERVER_HEADLESS=true
11
  ENV STREAMLIT_SERVER_ENABLECORS=false
12
  ENV STREAMLIT_SERVER_ENABLEXSRSFPROTECTION=false
13
  ENV STREAMLIT_SERVER_PORT=7860
14
  ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
15
+ ENV PYTHONUNBUFFERED=1
16
 
 
17
  EXPOSE 7860
18
 
19
+ # Keep container alive by running Streamlit as main process
20
+ CMD /usr/local/bin/streamlit run app.py --server.port=7860 --server.address=0.0.0.0
21
+
22
+
23