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. --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index eaedc7f..891768a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,11 @@ RUN mkdir src \ COPY src ./src RUN cargo build --release +# espeak-rs-sys installs the espeak-ng data into the build directory and +# compiles that path in as the default. Without this the runtime image has no +# data files and TTS fails with "phontab: No such file or directory". +RUN cp -a target/release/build/espeak-rs-sys-*/out/share/espeak-ng-data /app/espeak-ng-data + # ── Runtime ─────────────────────────────────────────────────────────── FROM debian:trixie-slim @@ -65,11 +70,14 @@ RUN useradd --create-home --uid 1000 --shell /usr/sbin/nologin bot \ WORKDIR /app COPY --from=builder /app/target/release/senator-sperma /usr/local/bin/senator-sperma +# espeak looks for /espeak-ng-data. +COPY --from=builder /app/espeak-ng-data /usr/share/espeak-ng-data USER bot ENV TZ=Europe/Warsaw \ TTS_MODEL_PATH=/app/piper \ + PIPER_ESPEAKNG_DATA_DIRECTORY=/usr/share \ RUST_LOG=info \ HOME=/home/bot -- cgit v1.2.3