Spaces:
Running
Running
| FROM python:3.11-slim | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| ENV YOLO_CONFIG_DIR="/tmp/Ultralytics" | |
| # Tắt các bộ tăng tốc CPU đang bị lỗi của PaddlePaddle 3.x | |
| ENV FLAGS_enable_pir_api=0 | |
| ENV FLAGS_use_mkldnn=0 | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| WORKDIR /home/user/app | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Cài đặt "cặp đôi hoàn hảo" đã được kiểm chứng | |
| RUN pip install --no-cache-dir paddlepaddle==2.6.2 | |
| RUN pip install --no-cache-dir paddleocr==2.8.1 | |
| COPY --chown=user:user . . | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "--workers", "1", "--timeout", "600", "--bind", "0.0.0.0:7860", "app:app"] |