FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04 ENV DEBIAN_FRONTEND=noninteractive \ PYTHONUNBUFFERED=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ git \ libportaudio2 \ libsndfile1 \ espeak-ng \ ffmpeg \ python3-pip \ curl \ build-essential \ && rm -rf /var/lib/apt/lists/* RUN pip install --break-system-packages --no-cache-dir uv # Ubuntu 24.04 ya trae un usuario 'ubuntu' con UID 1000 — hay que sacarlo antes. RUN userdel -r ubuntu 2>/dev/null || true \ && useradd -m -u 1000 user USER user ENV HOME=/home/user \ HF_HOME=/home/user/hf_cache WORKDIR /home/user/app # venv con Python 3.11 (numba/llvmlite viejos no compilan en 3.12). RUN uv venv /home/user/venv --python 3.11 ENV VIRTUAL_ENV=/home/user/venv \ PATH=/home/user/venv/bin:/home/user/.local/bin:$PATH # Torch pinneado a 2.10.0 desde el índice CUDA 12.8. La 2.11 tiene un bug # conocido en _dynamo/polyfills/sys.py (Duplicate dispatch rule para sys.intern) # que rompe el import de transformers.flex_attention. RUN uv pip install \ torch==2.10.0 torchaudio==2.10.0 \ --index-url https://download.pytorch.org/whl/cu128 # qwentts-cpp-python (extra ggml de faster-qwen3-tts) — no está en PyPI para # nuestra CUDA, se instala del wheelhouse de HF. RUN uv pip install \ "https://huggingface.co/datasets/andito/qwentts-cpp-python-wheels/resolve/main/whl/cu128/qwentts_cpp_python-0.3.0+cu128-py3-none-manylinux_2_35_x86_64.whl" # speech-to-speech desde main. RUN uv pip install \ "speech-to-speech @ git+https://github.com/huggingface/speech-to-speech.git@main" RUN uv pip install num2words COPY --chown=user:user entrypoint.sh /home/user/app/entrypoint.sh RUN chmod +x /home/user/app/entrypoint.sh EXPOSE 8765 CMD ["/home/user/app/entrypoint.sh"]