AreejMehboob commited on
Commit
73ad490
·
verified ·
1 Parent(s): ef1b0fb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -20,6 +20,15 @@ RUN mkdir -p /app/.cache/huggingface/transformers \
20
  && mkdir -p /app/.streamlit \
21
  && chmod -R 777 /app
22
 
 
 
 
 
 
 
 
 
 
23
  # Copy files
24
  COPY requirements.txt ./
25
  COPY src/ ./src/
@@ -27,11 +36,9 @@ COPY src/ ./src/
27
  # Install Python dependencies
28
  RUN pip install --no-cache-dir -r requirements.txt
29
 
30
- # Expose Streamlit's default port
31
  EXPOSE 8501
32
 
33
- # Healthcheck for container status
34
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
 
35
 
36
- # Start the Streamlit app
37
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
20
  && mkdir -p /app/.streamlit \
21
  && chmod -R 777 /app
22
 
23
+ # Set Streamlit config to disable CORS and XSRF protection
24
+ RUN echo "\
25
+ [server]\n\
26
+ headless = true\n\
27
+ port = 8501\n\
28
+ enableCORS = false\n\
29
+ enableXsrfProtection = false\n\
30
+ " > /app/.streamlit/config.toml
31
+
32
  # Copy files
33
  COPY requirements.txt ./
34
  COPY src/ ./src/
 
36
  # Install Python dependencies
37
  RUN pip install --no-cache-dir -r requirements.txt
38
 
 
39
  EXPOSE 8501
40
 
41
+ ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
42
+
43
+
44