Gagandeep12 commited on
Commit
2234729
·
verified ·
1 Parent(s): f999af8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -13
Dockerfile CHANGED
@@ -1,27 +1,27 @@
 
1
  FROM python:3.10-slim
2
 
3
- # Install system dependencies
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
- tesseract-ocr \
6
- tesseract-ocr-hin \
7
- libgl1 \
8
- libglib2.0-0 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- WORKDIR /app
 
12
 
13
  # Install Python dependencies
14
- COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Pre-download EasyOCR models into /app/.EasyOCR
18
- # Pre-download EasyOCR models into /app/.EasyOCR (baked into image)
19
- RUN python3 -c "import easyocr; easyocr.Reader(['en','hi'], gpu=False, model_storage_directory='/app/.EasyOCR', user_network_directory='/app/.EasyOCR/user_network')"
20
-
21
-
22
- # Copy app files
23
  COPY . .
24
 
 
25
  EXPOSE 7860
26
 
 
27
  CMD ["python", "app.py"]
 
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 PyPDF2 + requests)
8
  RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ libpoppler-cpp-dev \
11
+ pkg-config \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy requirements first (for caching layers)
15
+ COPY requirements.txt .
16
 
17
  # Install Python dependencies
 
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy project files
 
 
 
 
 
21
  COPY . .
22
 
23
+ # Expose Hugging Face default port
24
  EXPOSE 7860
25
 
26
+ # Start Flask app
27
  CMD ["python", "app.py"]