Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -3
Dockerfile
CHANGED
|
@@ -1,9 +1,12 @@
|
|
| 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 \
|
|
@@ -12,6 +15,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 12 |
# Set work directory
|
| 13 |
WORKDIR /app
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Copy requirements
|
| 16 |
COPY requirements.txt .
|
| 17 |
|
|
@@ -19,7 +26,7 @@ COPY requirements.txt .
|
|
| 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/
|
| 23 |
|
| 24 |
# Copy app code
|
| 25 |
COPY app.py .
|
|
@@ -28,4 +35,4 @@ COPY app.py .
|
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
# Run app
|
| 31 |
-
CMD ["python", "app.py"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
# Avoid interactive prompts
|
| 4 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
|
| 6 |
+
# Set environment variables for EasyOCR and Ultralytics
|
| 7 |
+
ENV EASYOCR_MODULE_PATH=/app/.EasyOCR
|
| 8 |
+
ENV YOLO_CONFIG_DIR=/app/.config/Ultralytics
|
| 9 |
+
|
| 10 |
# Install system dependencies
|
| 11 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
git curl build-essential ffmpeg libsm6 libxext6 \
|
|
|
|
| 15 |
# Set work directory
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
+
# Create directories for EasyOCR and Ultralytics with appropriate permissions
|
| 19 |
+
RUN mkdir -p /app/.EasyOCR /app/.config/Ultralytics \
|
| 20 |
+
&& chmod -R 777 /app/.EasyOCR /app/.config/Ultralytics
|
| 21 |
+
|
| 22 |
# Copy requirements
|
| 23 |
COPY requirements.txt .
|
| 24 |
|
|
|
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
# Download YOLOv8 ANPR model weights
|
| 29 |
+
RUN curl -L -o /app/anpr_yolov8.pt "https://github.com/madalinabuzatu/yolov8-license-plate-detection/releases/download/v1.0/best.pt"
|
| 30 |
|
| 31 |
# Copy app code
|
| 32 |
COPY app.py .
|
|
|
|
| 35 |
EXPOSE 7860
|
| 36 |
|
| 37 |
# Run app
|
| 38 |
+
CMD ["python", "app.py"]
|