File size: 646 Bytes
3a47a7e
 
1462923
3a47a7e
 
 
0703532
a82d5b4
0703532
 
 
a82d5b4
 
3a47a7e
0703532
a82d5b4
0703532
06ffe09
3a47a7e
0703532
a82d5b4
3a47a7e
0703532
3a47a7e
 
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
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"]