Dewasheesh commited on
Commit
fac7cb3
·
verified ·
1 Parent(s): 2b5a37e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -1,18 +1,21 @@
1
- # Use a minimal base image with Python 3.9 installed
2
  FROM python:3.9-slim
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Copy all files from the host to the container
8
  COPY . .
9
 
10
- # Install Python dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
 
12
 
13
- # Set environment variable so Hugging Face knows it's a Streamlit app
14
  ENV STREAMLIT_SERVER_PORT=7860
15
  ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
 
 
16
 
17
- # Start the app (NOTE: CMD is optional — Hugging Face runs "streamlit run app.py" automatically)
18
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
 
1
+ # Use a minimal image with Python 3.9
2
  FROM python:3.9-slim
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy all project files
8
  COPY . .
9
 
10
+ # Upgrade pip and install dependencies
11
+ RUN pip install --no-cache-dir --upgrade pip \
12
+ && pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Streamlit-specific ENV vars for Hugging Face
15
  ENV STREAMLIT_SERVER_PORT=7860
16
  ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
17
+ ENV STREAMLIT_SERVER_ENABLE_CORS=false
18
+ ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
19
 
20
+ # CMD to launch Streamlit
21
+ CMD ["streamlit", "run", "app.py"]