Ahmad-01 commited on
Commit
2494b91
·
verified ·
1 Parent(s): 3d8ce79

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -1
Dockerfile CHANGED
@@ -2,6 +2,9 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
@@ -10,11 +13,13 @@ COPY . .
10
  # Expose Streamlit's default port
11
  EXPOSE 8501
12
 
13
- # Disable CSRF and CORS via environment variables (override any config)
14
  ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
15
  ENV STREAMLIT_SERVER_ENABLE_CORS=false
16
  ENV STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200
17
 
 
18
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
19
 
 
20
  ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install curl for health check
6
+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
7
+
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
 
13
  # Expose Streamlit's default port
14
  EXPOSE 8501
15
 
16
+ # Disable CSRF and CORS (override any config file)
17
  ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
18
  ENV STREAMLIT_SERVER_ENABLE_CORS=false
19
  ENV STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200
20
 
21
+ # Health check to ensure the app is running
22
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
23
 
24
+ # Run the app
25
  ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]