pdf_analysis / Dockerfile
randusertry's picture
Update Dockerfile
06ffe09 verified
Raw
History Blame Contribute Delete
646 Bytes
FROM python:3.10-slim
# Install light dependencies needed for PDF/Image processing
RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
# Set up a non-root user (Hugging Face Requirement)
RUN useradd -m -u 1000 user
WORKDIR /app
# Switch to user context
USER user
ENV PATH="/home/user/.local/bin:${PATH}"
# Install Python requirements
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
RUN pip install pymupdf
# Copy your application code
COPY --chown=user . .
# Expose port 7860 for HF Spaces
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]