mcspeak/Dockerfile
Ryan Malloy d054caa43c Rename project to mcspeak, add README
Rename all user-facing references from tts-mcp to mcspeak: service name,
container, compose project, Dockerfile CMD, FastMCP instance, MCP config,
startup logs, temp dir, and CLAUDE.md header. Python module stays tts_mcp
(import name != package name is standard practice).

README covers quick start, MCP tools, engines, features, config, Docker
setup, and architecture.
2026-03-04 19:46:25 -07:00

44 lines
1.4 KiB
Docker

FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
# PipeWire client tools — pw-play connects to the host's PipeWire socket
# pulseaudio-utils provides pactl for media ducking (volume control via PulseAudio compat)
RUN apt-get update && apt-get install -y --no-install-recommends \
pipewire-bin \
pulseaudio-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1
# Create venv
RUN uv venv
# Install CPU-only torch first (saves ~3GB vs CUDA — SNAC runs on CPU anyway)
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install torch --index-url https://download.pytorch.org/whl/cpu
# Install project dependencies (torch already satisfied, won't redownload)
COPY pyproject.toml ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --no-deps -r pyproject.toml 2>/dev/null || true
# Copy source and install project
COPY src/ src/
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install .
# Non-root user matching host uid for PipeWire socket access
RUN useradd -u 1000 -m tts \
&& mkdir -p /home/tts/.cache/huggingface /data \
&& chown -R tts:tts /home/tts/.cache /data
USER tts
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 8371
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s \
CMD python -c "import socket; s=socket.create_connection(('127.0.0.1',8371),2); s.close()" || exit 1
CMD ["mcspeak"]