# 1. On récupère la version la plus récente d'UV FROM ghcr.io/astral-sh/uv:latest AS uv_source # 2. Image de base stable FROM debian:stable-slim # Disable Python stdout buffering to ensure logs are printed immediately ENV PYTHONUNBUFFERED=1 # Install system dependencies in one layer, clear APT cache # tini reaps orphaned zombie processes (MCP stdio subprocesses, git, bun, etc.) RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential python3 ripgrep ffmpeg gcc python3-dev libffi-dev procps git openssh-client docker-cli tini \ curl poppler-utils imagemagick \ texlive-latex-base texlive-latex-extra texlive-fonts-recommended texlive-xetex texlive-science \ qemu-user-static binfmt-support qemu-user-binfmt \ emacs-nox \ libportaudio2 \ hipcc espeak-ng && \ rm -rf /var/lib/apt/lists/* # Création de l'utilisateur 'hermes' directement avec les bons accès RUN useradd -u 10000 -m -d /opt/data hermes # Copie d'uv (dernière version) COPY --chmod=0755 --from=uv_source /uv /usr/local/bin/ WORKDIR /opt/hermes # On donne la propriété du dossier de travail à l'utilisateur hermes RUN chown hermes:hermes /opt/hermes # ---------- Coqui TTS venv (Python 3.11 + PyTorch ROCm) ---------- # Install Python 3.11 via uv for Coqui compatibility RUN uv python install 3.11 # Create the coqui venv and install PyTorch ROCm + TTS RUN uv venv --python 3.11 /opt/coqui-tts RUN uv pip install --python /opt/coqui-tts/bin/python3 --no-cache-dir \ torch==2.3.1+rocm5.7 \ torchaudio==2.3.1+rocm5.7 \ --index-url https://download.pytorch.org/whl/rocm5.7 RUN uv pip install --python /opt/coqui-tts/bin/python3 --no-cache-dir TTS setuptools # Fix executable stack on bundled torch AMD libraries (required for ROCm) RUN /opt/coqui-tts/bin/python3 -c " import struct, os, glob torch_lib = '/opt/coqui-tts/lib/python3.11/site-packages/torch/lib' for so in glob.glob(os.path.join(torch_lib, '*.so*')): try: with open(so, 'r+b') as f: if f.read(4) != b'\x7fELF': continue f.seek(0) h = f.read(64) e_phoff = struct.unpack_from('