ci / test (push) Successful in 24s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.3 KiB
Docker
31 lines
1.3 KiB
Docker
# Piper-TTS hinter dem OpenAI-kompatiblen knaster-TTS-Dienst. Build-Kontext: Repo-Wurzel.
|
||
# Hinweis: piper-tts ab 1.3 ist GPL-3.0 – läuft hier als eigenständiger Dienst.
|
||
FROM python:3.12-slim
|
||
|
||
ARG PIPER_VERSION=1.3.0
|
||
ARG VOICE_BASE=https://huggingface.co/rhasspy/piper-voices/resolve/main/de/de_DE
|
||
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
|
||
WORKDIR /app
|
||
|
||
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
||
RUN pip install "piper-tts==${PIPER_VERSION}"
|
||
|
||
COPY core/pyproject.toml core/pyproject.toml
|
||
COPY core/src core/src
|
||
RUN pip install ./core
|
||
|
||
RUN mkdir -p /voices && cd /voices \
|
||
&& curl -fsSL -o de_DE-thorsten-medium.onnx "${VOICE_BASE}/thorsten/medium/de_DE-thorsten-medium.onnx" \
|
||
&& curl -fsSL -o de_DE-thorsten-medium.onnx.json "${VOICE_BASE}/thorsten/medium/de_DE-thorsten-medium.onnx.json"
|
||
|
||
ENV KNASTER_TTS_VOICES=thorsten=/voices/de_DE-thorsten-medium.onnx \
|
||
KNASTER_TTS_CMD="piper -m {model} -f {out}" \
|
||
KNASTER_TTS_PARALLEL=2
|
||
|
||
RUN useradd --system --uid 10002 tts
|
||
USER tts
|
||
EXPOSE 8090
|
||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
||
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8090/health', timeout=4)"
|
||
CMD ["knaster", "tts-serve", "--host", "0.0.0.0", "--port", "8090"]
|