# Dev/smoke-test image for the tts-gateway inference sidecar (Phase 3/4 of
# TTS_GATEWAY_PLAN.md). NOT the polished production image - Phase 5 (deferred)
# covers the final containerization/CI/model-artifact-distribution decisions.
# Base image matches nik-gpu's driver 570.211.01 / CUDA 12.8.
FROM pytorch/pytorch:2.9.1-cuda12.8-cudnn9-runtime

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

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

COPY . .

# models/models.py does a module-level `import monotonic_align`, even though
# this sidecar's infer()-only path never calls it (only the training-time
# forward() does) - the extension still has to build for the import itself to
# succeed. See tmp/reference/uma-tts-api/spike/FINDINGS.md for the identical
# issue hit during the Phase 0 spike.
RUN cd monotonic_align && python setup.py build_ext --inplace

EXPOSE 50054
CMD ["python", "server.py"]
