Files
esh-pfi-infrastructure/stacks/zonos/adapter/Dockerfile
T
vh 81efa8da96 feat(zonos): OpenAI-ish REST adapter for asset-engine routing
Upstream Zonos ships only Gradio + Python SDK — no REST surface — so
asset-engine (which routes a clean JSON POST to /v1/audio/speech) can't
target it directly. Add a thin FastAPI adapter (stacks/zonos/adapter/):
POST /v1/audio/speech in front of the Zonos SDK, built FROM local/zonos
to reuse torch/CUDA/SDK. Returns a JSON envelope {audio, audio_format,
seed} — the seed rides back so asset-engine regenerate/fork can pin it
(Zonos is the fleet's first genuinely seedable TTS). compose gains a
zonos-api service on 8201; .env.example gains the port + voices dir.
2026-05-31 13:59:10 -07:00

23 lines
847 B
Docker

# 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"]