File size: 686 Bytes
00ce77e 375a4a2 3eb223d 28c3b99 a4b473b 3eb223d 952772c 92a8cfe 952772c 32b59cd 92a8cfe 3eb223d 375a4a2 28c3b99 a4b473b 00ce77e a4b473b 00ce77e a4b473b 00ce77e |
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 |
FROM python:3.10-slim
# Set all required environment variables
ENV HF_HOME=/tmp/huggingface
ENV TORCH_HOME=/tmp/torch
ENV EASYOCR_HOME=/tmp/.easyocr
ENV HOME=/tmp
# System dependencies for OpenCV and EasyOCR
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
tesseract-ocr \
&& rm -rf /var/lib/apt/lists/*
# Pre-create the EasyOCR directory
RUN mkdir -p /tmp/.easyocr && chmod -R 777 /tmp/.easyocr
# Set working directory
WORKDIR /app
COPY . .
# Install dependencies
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|