Spaces:
Running
Running
File size: 967 Bytes
88b7b99 3b936b6 88b7b99 7b19310 3941a06 3b936b6 a8264d3 88b7b99 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV EASYOCR_MODULE_PATH=/app/.EasyOCR
ENV YOLO_CONFIG_DIR=/app/.config/Ultralytics
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl build-essential ffmpeg libsm6 libxext6 file \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN mkdir -p /app/.EasyOCR /app/.config/Ultralytics \
&& chmod -R 777 /app/.EasyOCR /app/.config/Ultralytics
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN curl -L --retry 3 --retry-delay 5 -o /app/anpr_yolov8.pt \
"https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt" \
&& [ -s /app/anpr_yolov8.pt ] || { echo "Error: Model download failed or file is empty"; exit 1; } \
&& { file /app/anpr_yolov8.pt | grep -q -E "Python|data|gzip" || { echo "Error: anpr_yolov8.pt is not a valid file type"; exit 1; }; }
COPY app.py .
EXPOSE 7860
CMD ["python", "app.py"] |