From 722883ab4a4583b799ce8bfd0cfad70b4b89daf9 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 12:00:03 +0100 Subject: docker: bake espeak-ng data for Piper TTS espeak-rs-sys installs espeak-ng-data into the build tree and compiles that path in as the default, so the runtime image failed with 'phontab: No such file or directory'. Copy the data from the builder to /usr/share and point PIPER_ESPEAKNG_DATA_DIRECTORY there; compose overrides the host path from .env. Also trim trailing slashes from Copyparty base URLs, document that env_file changes need --force-recreate, and clean inline comments in .env.example. --- README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e52c1b9..699066d 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,11 @@ docker compose up -d --build Or without Compose: ```bash -docker build -t senator-sperma . +docker buildx build --load -t senator-sperma:latest . docker run -d --name senator-sperma --restart unless-stopped \ --env-file .env \ -e TTS_MODEL_PATH=/app/piper \ + -e PIPER_ESPEAKNG_DATA_DIRECTORY=/usr/share \ -v "$PWD/data:/app/data" \ -v "$PWD/piper:/app/piper:ro" \ senator-sperma @@ -86,14 +87,29 @@ Notes: overrides `TTS_MODEL_PATH` to `/app/piper`, so the absolute host path in `.env` is harmless. Put the `.onnx` and `.onnx.json` files there (the same directory used for local runs). +- The espeak-ng data used by Piper is baked into the image at + `/usr/share/espeak-ng-data`; the container sets + `PIPER_ESPEAKNG_DATA_DIRECTORY=/usr/share`. This overrides the host path in + `.env`. - The container runs as uid 1000. Make sure `data/` is writable by that uid. - `TZ` defaults to `Europe/Warsaw` for cron jobs; override it in `compose.yaml` or with `-e TZ=...` if needed. -- If Copyparty runs on the host, use `http://host.docker.internal:` in - `.env` and enable the commented `extra_hosts` entry in `compose.yaml`. +- If Copyparty or a local LLM runs on the host, use the host's LAN IP (for + example `http://10.0.0.3:2137/...`) and make sure the service listens on + `0.0.0.0` or that LAN IP, not only `127.0.0.1`. `localhost` inside the + container is the container itself. +- After editing `.env`, recreate the container: + `docker compose up -d --force-recreate`. `docker compose restart` does not + reload `env_file` values. Verify what the container actually sees with: + `docker compose exec senator-sperma env | grep -E 'LLM_API_URL|TTS_MODEL_PATH|PIPER_ESPEAKNG'` + and check the resolved LLM URL with `docker compose logs | grep 'LLM client'`. +- To test the LLM endpoint from inside the container: + `docker compose exec senator-sperma python3 -c 'import urllib.request; print(urllib.request.urlopen("http://10.0.0.3:2137/v1/models", timeout=5).status)'` + If that fails, the host service is probably listening only on `127.0.0.1`; + bind it to `0.0.0.0` (or the LAN IP) and allow the port through the firewall. - If the build fails to resolve `crates.io` or `deb.debian.org`, run - `docker build --network=host -t senator-sperma .`; `compose.yaml` already - sets `network: host` for builds on this host. + `docker buildx build --load --network=host -t senator-sperma:latest .`; + `compose.yaml` already sets `network: host` for builds on this host. - yt-dlp is fetched from the latest upstream release at image build time. Rebuild with `--no-cache` (`docker compose build --no-cache`) to refresh it. -- cgit v1.2.3