diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 26 |
1 files changed, 21 insertions, 5 deletions
| @@ -69,10 +69,11 @@ docker compose up -d --build | |||
| 69 | Or without Compose: | 69 | Or without Compose: |
| 70 | 70 | ||
| 71 | ```bash | 71 | ```bash |
| 72 | docker build -t senator-sperma . | 72 | docker buildx build --load -t senator-sperma:latest . |
| 73 | docker run -d --name senator-sperma --restart unless-stopped \ | 73 | docker run -d --name senator-sperma --restart unless-stopped \ |
| 74 | --env-file .env \ | 74 | --env-file .env \ |
| 75 | -e TTS_MODEL_PATH=/app/piper \ | 75 | -e TTS_MODEL_PATH=/app/piper \ |
| 76 | -e PIPER_ESPEAKNG_DATA_DIRECTORY=/usr/share \ | ||
| 76 | -v "$PWD/data:/app/data" \ | 77 | -v "$PWD/data:/app/data" \ |
| 77 | -v "$PWD/piper:/app/piper:ro" \ | 78 | -v "$PWD/piper:/app/piper:ro" \ |
| 78 | senator-sperma | 79 | senator-sperma |
| @@ -86,14 +87,29 @@ Notes: | |||
| 86 | overrides `TTS_MODEL_PATH` to `/app/piper`, so the absolute host path in | 87 | 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 | `.env` is harmless. Put the `.onnx` and `.onnx.json` files there (the same |
| 88 | directory used for local runs). | 89 | directory used for local runs). |
| 90 | - The espeak-ng data used by Piper is baked into the image at | ||
| 91 | `/usr/share/espeak-ng-data`; the container sets | ||
| 92 | `PIPER_ESPEAKNG_DATA_DIRECTORY=/usr/share`. This overrides the host path in | ||
| 93 | `.env`. | ||
| 89 | - The container runs as uid 1000. Make sure `data/` is writable by that uid. | 94 | - 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 | 95 | - `TZ` defaults to `Europe/Warsaw` for cron jobs; override it in |
| 91 | `compose.yaml` or with `-e TZ=...` if needed. | 96 | `compose.yaml` or with `-e TZ=...` if needed. |
| 92 | - If Copyparty runs on the host, use `http://host.docker.internal:<port>` in | 97 | - If Copyparty or a local LLM runs on the host, use the host's LAN IP (for |
| 93 | `.env` and enable the commented `extra_hosts` entry in `compose.yaml`. | 98 | example `http://10.0.0.3:2137/...`) and make sure the service listens on |
| 99 | `0.0.0.0` or that LAN IP, not only `127.0.0.1`. `localhost` inside the | ||
| 100 | container is the container itself. | ||
| 101 | - After editing `.env`, recreate the container: | ||
| 102 | `docker compose up -d --force-recreate`. `docker compose restart` does not | ||
| 103 | reload `env_file` values. Verify what the container actually sees with: | ||
| 104 | `docker compose exec senator-sperma env | grep -E 'LLM_API_URL|TTS_MODEL_PATH|PIPER_ESPEAKNG'` | ||
| 105 | and check the resolved LLM URL with `docker compose logs | grep 'LLM client'`. | ||
| 106 | - To test the LLM endpoint from inside the container: | ||
| 107 | `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)'` | ||
| 108 | If that fails, the host service is probably listening only on `127.0.0.1`; | ||
| 109 | bind it to `0.0.0.0` (or the LAN IP) and allow the port through the firewall. | ||
| 94 | - If the build fails to resolve `crates.io` or `deb.debian.org`, run | 110 | - If the build fails to resolve `crates.io` or `deb.debian.org`, run |
| 95 | `docker build --network=host -t senator-sperma .`; `compose.yaml` already | 111 | `docker buildx build --load --network=host -t senator-sperma:latest .`; |
| 96 | sets `network: host` for builds on this host. | 112 | `compose.yaml` already sets `network: host` for builds on this host. |
| 97 | - yt-dlp is fetched from the latest upstream release at image build time. | 113 | - 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. | 114 | Rebuild with `--no-cache` (`docker compose build --no-cache`) to refresh it. |
| 99 | 115 | ||
