diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-27 18:35:58 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-27 18:35:58 +0100 |
| commit | a82489c95f8c8f3e55f92939224599598bd0de96 (patch) | |
| tree | 59591c88cede5a3aef8255fad713ddd9b329709c /README.md | |
| parent | music: group playback commands under /music (diff) | |
| download | senator-sperma-a82489c95f8c8f3e55f92939224599598bd0de96.tar.gz senator-sperma-a82489c95f8c8f3e55f92939224599598bd0de96.zip | |
docker: build and run on Debian trixie
Add a multi-stage image that compiles inside Debian trixie and runs on the
same glibc/libssl/libopus, avoiding the Arch-built binary failing on
Debian. The runtime image installs ffmpeg, qalc, the shared libraries, and
the latest yt-dlp zipapp, and runs as uid 1000.
compose.yaml mounts data/ and piper/, overrides TTS_MODEL_PATH for the
container layout, and builds with host networking because the default
Docker bridge DNS cannot resolve crates.io or deb.debian.org on this host.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 41 |
1 files changed, 41 insertions, 0 deletions
| @@ -56,6 +56,47 @@ bot falls back to Google Translate TTS. | |||
| 56 | cargo run --release | 56 | cargo run --release |
| 57 | ``` | 57 | ``` |
| 58 | 58 | ||
| 59 | ## Docker | ||
| 60 | |||
| 61 | The image builds and runs on Debian trixie, so it does not depend on the | ||
| 62 | host's gcc/glibc version. This is the recommended way to deploy on Debian | ||
| 63 | when developing on a rolling-release distro. | ||
| 64 | |||
| 65 | ```bash | ||
| 66 | docker compose up -d --build | ||
| 67 | ``` | ||
| 68 | |||
| 69 | Or without Compose: | ||
| 70 | |||
| 71 | ```bash | ||
| 72 | docker build -t senator-sperma . | ||
| 73 | docker run -d --name senator-sperma --restart unless-stopped \ | ||
| 74 | --env-file .env \ | ||
| 75 | -e TTS_MODEL_PATH=/app/piper \ | ||
| 76 | -v "$PWD/data:/app/data" \ | ||
| 77 | -v "$PWD/piper:/app/piper:ro" \ | ||
| 78 | senator-sperma | ||
| 79 | ``` | ||
| 80 | |||
| 81 | Notes: | ||
| 82 | |||
| 83 | - `data/` holds the SQLite database and is mounted for persistence. Create it | ||
| 84 | first (`mkdir -p data`) so it is owned by your user rather than root. | ||
| 85 | - `piper/` holds the Piper model and is mounted read-only; the container | ||
| 86 | overrides `TTS_MODEL_PATH` to `/app/piper`, so the absolute host path in | ||
| 87 | `.env` is harmless. Put the `.onnx` and `.onnx.json` files there (the same | ||
| 88 | directory used for local runs). | ||
| 89 | - The container runs as uid 1000. Make sure `data/` is writable by that uid. | ||
| 90 | - `TZ` defaults to `Europe/Warsaw` for cron jobs; override it in | ||
| 91 | `compose.yaml` or with `-e TZ=...` if needed. | ||
| 92 | - If Copyparty runs on the host, use `http://host.docker.internal:<port>` in | ||
| 93 | `.env` and enable the commented `extra_hosts` entry in `compose.yaml`. | ||
| 94 | - If the build fails to resolve `crates.io` or `deb.debian.org`, run | ||
| 95 | `docker build --network=host -t senator-sperma .`; `compose.yaml` already | ||
| 96 | sets `network: host` for builds on this host. | ||
| 97 | - yt-dlp is fetched from the latest upstream release at image build time. | ||
| 98 | Rebuild with `--no-cache` (`docker compose build --no-cache`) to refresh it. | ||
| 99 | |||
| 59 | ## Commands | 100 | ## Commands |
| 60 | 101 | ||
| 61 | Slash commands are autoregistered globally on startup. Some are registered | 102 | Slash commands are autoregistered globally on startup. Some are registered |
