File size: 726 Bytes
36dd4d2
307de64
 
36dd4d2
307de64
 
 
 
 
 
 
36dd4d2
 
 
307de64
 
 
 
 
36dd4d2
 
 
 
 
307de64
 
 
 
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
# Hugging Face Spaces-compatible image (SDK: docker, app_port: 8000).
FROM python:3.12-slim

# pikepdf needs QPDF; lxml needs libxml2/libxslt. Installed as root at build.
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        qpdf \
        libxml2 \
        libxslt1.1 \
    && rm -rf /var/lib/apt/lists/*

# Run as a non-root user (Hugging Face Spaces best practice).
RUN useradd -m -u 1000 user

WORKDIR /app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY --chown=user backend ./backend
COPY --chown=user frontend ./frontend
COPY --chown=user tools ./tools

USER user

EXPOSE 8000

CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000"]