File size: 661 Bytes
0330372 e92668e 0330372 e92668e 0330372 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 1. Use the official light Python image
FROM python:3.10-slim
# 2. Install modern system libraries required by OpenCV / EasyOCR
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# 3. Set the directory path inside the container
WORKDIR /code
# 4. Copy and install your Python dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# 5. Copy your application script
COPY ./app.py /code/app.py
# 6. Run the API on port 7860 (Hugging Face's mandatory web port)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|