aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-28 12:00:03 +0100
committersalmonik <salmonik@tuta.io>2026-10-28 12:00:03 +0100
commit722883ab4a4583b799ce8bfd0cfad70b4b89daf9 (patch)
tree8b19ff073d3981ebc4e3a5428cd953463fa5c46e /Dockerfile
parentcontextual play should add to the last in the queue (diff)
downloadsenator-sperma-722883ab4a4583b799ce8bfd0cfad70b4b89daf9.tar.gz
senator-sperma-722883ab4a4583b799ce8bfd0cfad70b4b89daf9.zip
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.
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
index eaedc7f..891768a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -33,6 +33,11 @@ RUN mkdir src \
33COPY src ./src 33COPY src ./src
34RUN cargo build --release 34RUN cargo build --release
35 35
36# espeak-rs-sys installs the espeak-ng data into the build directory and
37# compiles that path in as the default. Without this the runtime image has no
38# data files and TTS fails with "phontab: No such file or directory".
39RUN cp -a target/release/build/espeak-rs-sys-*/out/share/espeak-ng-data /app/espeak-ng-data
40
36# ── Runtime ─────────────────────────────────────────────────────────── 41# ── Runtime ───────────────────────────────────────────────────────────
37FROM debian:trixie-slim 42FROM debian:trixie-slim
38 43
@@ -65,11 +70,14 @@ RUN useradd --create-home --uid 1000 --shell /usr/sbin/nologin bot \
65 70
66WORKDIR /app 71WORKDIR /app
67COPY --from=builder /app/target/release/senator-sperma /usr/local/bin/senator-sperma 72COPY --from=builder /app/target/release/senator-sperma /usr/local/bin/senator-sperma
73# espeak looks for <PIPER_ESPEAKNG_DATA_DIRECTORY>/espeak-ng-data.
74COPY --from=builder /app/espeak-ng-data /usr/share/espeak-ng-data
68 75
69USER bot 76USER bot
70 77
71ENV TZ=Europe/Warsaw \ 78ENV TZ=Europe/Warsaw \
72 TTS_MODEL_PATH=/app/piper \ 79 TTS_MODEL_PATH=/app/piper \
80 PIPER_ESPEAKNG_DATA_DIRECTORY=/usr/share \
73 RUST_LOG=info \ 81 RUST_LOG=info \
74 HOME=/home/bot 82 HOME=/home/bot
75 83