Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 727 Bytes
ae603f5 | 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 | FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PORT=7860
WORKDIR /app
# System packages required for OCR and PDF/image processing
RUN apt-get update && apt-get install -y --no-install-recommends \
tesseract-ocr \
tesseract-ocr-eng \
libglib2.0-0 \
libgl1 \
libsm6 \
libxext6 \
libxrender1 \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt
RUN pip install --upgrade pip && pip install -r /app/requirements.txt
COPY . /app
EXPOSE 7860
# Set APP_MODULE in Space Variables if needed; default is app.py FastAPI instance.
CMD ["sh", "-c", "uvicorn ${APP_MODULE:-app:app} --host 0.0.0.0 --port ${PORT}"] |