HMZaheer commited on
Commit
33f3abf
·
verified ·
1 Parent(s): c3b4b68

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -10
Dockerfile CHANGED
@@ -1,25 +1,30 @@
1
- # Use the official lightweight Python image
2
  FROM python:3.10-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
 
9
  libgl1 \
10
- poppler-utils \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Install pip dependencies
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy app files
18
- COPY app.py .
19
- COPY README.md .
20
 
21
- # Expose port
22
  EXPOSE 7860
23
 
24
- # Run the app
25
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
 
 
 
 
 
1
+ # Use official lightweight Python image
2
  FROM python:3.10-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies (for scientific libs + image processing)
8
  RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
  libgl1 \
11
+ libglib2.0-0 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy requirements and install
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy app code
19
+ COPY . .
 
20
 
21
+ # Streamlit runs on port 7860 inside Hugging Face
22
  EXPOSE 7860
23
 
24
+ # Set environment variables for Streamlit
25
+ ENV STREAMLIT_SERVER_HEADLESS=true \
26
+ STREAMLIT_SERVER_PORT=7860 \
27
+ STREAMLIT_SERVER_ENABLECORS=false
28
+
29
+ # Run the Streamlit app
30
+ CMD ["streamlit", "run", "app.py"]