| FROM debian:stable-slim | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update -y && apt-get install -y --no-install-recommends \ | |
| ca-certificates curl git make \ | |
| python3 python3-venv python3-pip \ | |
| texlive-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex texlive-lang-french latexmk \ | |
| fonts-lmodern fonts-dejavu-core fonts-dejavu-mono \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Installer uv puis copier les binaires dans /usr/local/bin (disponible pour tous les utilisateurs) | |
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh \ | |
| && cp /root/.local/bin/uv /usr/local/bin/uv \ | |
| && cp /root/.local/bin/uvx /usr/local/bin/uvx | |
| COPY pyproject.toml ./ | |
| COPY uv.lock ./ | |
| RUN uv sync --frozen | |
| ENV PATH="/app/.venv/bin:$PATH" | |
| COPY . . | |
| # Créer un utilisateur non-root et lui donner les droits sur /app (incluant .venv) | |
| RUN useradd -m -u 1000 user && chown -R user:user /app | |
| USER user | |
| # Lancer l'interface Gradio (MCP inclus) pour Hugging Face Spaces sans utiliser uv au runtime | |
| # Respecter la variable d'environnement PORT fournie par la plateforme | |
| CMD ["/bin/sh", "-lc", "/app/.venv/bin/python generate_resume.py --serve --server-host 0.0.0.0 --server-port ${PORT:-7860}"] | |