muddasser commited on
Commit
4ea6378
·
verified ·
1 Parent(s): c553c28

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -14
Dockerfile CHANGED
@@ -1,26 +1,31 @@
 
1
  FROM python:3.10-slim
2
 
3
- # Set env vars for writable config
4
- ENV MPLCONFIGDIR=/tmp/matplotlib
5
- ENV YOLO_CONFIG_DIR=/tmp
6
- ENV HF_HOME=/tmp
7
- ENV PYTHONUNBUFFERED=1
8
 
 
 
 
 
 
 
9
  WORKDIR /app
10
 
11
- # Install dependencies
12
  COPY requirements.txt .
13
- RUN apt-get update && apt-get install -y --no-install-recommends \
14
- git curl build-essential ffmpeg libsm6 libxext6 \
15
- && pip install --no-cache-dir -r requirements.txt \
16
- && apt-get clean && rm -rf /var/lib/apt/lists/*
17
 
18
- # Copy model weights into container
19
- COPY anpr_yolov8.pt /app/anpr_yolov8.pt
 
 
 
20
 
21
- # Copy app files
22
- COPY app.py /app/app.py
23
 
 
24
  EXPOSE 7860
25
 
 
26
  CMD ["python", "app.py"]
 
1
+ # Base image
2
  FROM python:3.10-slim
3
 
4
+ # Avoid interactive prompts
5
+ ENV DEBIAN_FRONTEND=noninteractive
 
 
 
6
 
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ git curl build-essential ffmpeg libsm6 libxext6 \
10
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Set work directory
13
  WORKDIR /app
14
 
15
+ # Copy requirements
16
  COPY requirements.txt .
 
 
 
 
17
 
18
+ # Install Python packages
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Download YOLOv8 ANPR model weights
22
+ RUN curl -L -o /app/anpr_yolov8.pt "https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt"
23
 
24
+ # Copy app code
25
+ COPY app.py .
26
 
27
+ # Expose port for Spaces or local run
28
  EXPOSE 7860
29
 
30
+ # Run app
31
  CMD ["python", "app.py"]