# Thin OpenAI-ish REST adapter, layered on top of the already-built
# upstream Zonos image (local/zonos:<tag>) so we reuse its torch + CUDA +
# espeak-ng + Zonos SDK install rather than rebuilding the heavy base.
#
# Build arg ZONOS_BASE lets compose pin which base tag to layer on.
ARG ZONOS_BASE=local/zonos:v1
FROM ${ZONOS_BASE}

# libsndfile1 backs soundfile's wav/flac encode (the base image lacks it).
RUN apt-get update \
    && apt-get install -y --no-install-recommends libsndfile1 \
    && rm -rf /var/lib/apt/lists/*

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

WORKDIR /app
COPY server.py /app/server.py

# Container listens on 8000 internally; compose maps it to the host port.
EXPOSE 8000
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
