muddasser commited on
Commit
9e47172
·
verified ·
1 Parent(s): 570a0f3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -9
Dockerfile CHANGED
@@ -1,10 +1,8 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Prevent interactive prompts during installs
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
- # Install system dependencies (minimal for EasyOCR + Pillow)
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  build-essential \
10
  cmake \
@@ -12,22 +10,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
12
  python3-opencv \
13
  tesseract-ocr \
14
  libtesseract-dev \
 
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
- # Set work directory
18
  WORKDIR /app
19
 
20
- # Copy requirements first (to leverage caching)
21
  COPY requirements.txt .
22
 
23
- # Install Python dependencies
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
- # Copy app files
 
 
 
27
  COPY app.py .
28
 
29
- # Expose port for HF Spaces
30
  EXPOSE 7860
31
 
32
- # Run app
33
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  cmake \
 
10
  python3-opencv \
11
  tesseract-ocr \
12
  libtesseract-dev \
13
+ wget \
14
  && rm -rf /var/lib/apt/lists/*
15
 
 
16
  WORKDIR /app
17
 
18
+ # Copy requirements first for caching
19
  COPY requirements.txt .
20
 
 
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # Pre-download YOLO weights into /app
24
+ RUN wget https://github.com/ultralytics/assets/releases/download/v8.3.0/yolov8n.pt -O /app/yolov8n.pt
25
+
26
+ # Copy application code
27
  COPY app.py .
28
 
 
29
  EXPOSE 7860
30
 
 
31
  CMD ["python", "app.py"]