Spaces:
Sleeping
Sleeping
File size: 856 Bytes
a16cceb f2499d3 c177651 c791763 ec2a988 f2499d3 5029026 f2499d3 a16cceb f2499d3 c177651 b29d4b3 c791763 b29d4b3 f2499d3 a16cceb 1986b12 | 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 29 30 31 32 33 34 | 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"] |