fix(docker): use host hostname for downloader

This commit is contained in:
saltbo
2026-06-06 20:34:16 -04:00
parent 7e7eeb4ca7
commit 475cb46557
4 changed files with 19 additions and 0 deletions
+1
View File
@@ -31,6 +31,7 @@ services:
downloader:
image: ghcr.io/saltbo/zpan:latest-cli
command: ["downloader", "up"]
hostname: "${HOSTNAME:-zpan-downloader}"
ports:
- "${ZPAN_BT_PORT:-6881}:6881/tcp"
- "${ZPAN_BT_PORT:-6881}:6881/udp"
+1
View File
@@ -23,6 +23,7 @@ services:
downloader:
image: ghcr.io/saltbo/zpan:latest-cli
hostname: "${HOSTNAME:-zpan-downloader}"
ports:
- "${ZPAN_BT_PORT:-6881}:6881/tcp"
- "${ZPAN_BT_PORT:-6881}:6881/udp"
+1
View File
@@ -25,6 +25,7 @@ services:
build:
context: .
target: cli
hostname: "${HOSTNAME:-zpan-downloader}"
ports:
- "${ZPAN_BT_PORT:-6881}:6881/tcp"
- "${ZPAN_BT_PORT:-6881}:6881/udp"
+16
View File
@@ -39,6 +39,22 @@ ports:
Keep that port reachable from the internet if you want effective seeding and better peer connectivity. If multiple downloader containers run on the same host, give each one a different host port, for example `ZPAN_BT_PORT=6882`, while keeping the container side mapped to `6881`.
### Remote downloader hostname
Docker gives containers a generated hostname unless one is configured. The downloader uses the OS hostname during registration and heartbeats, so the compose files set the container hostname from the host environment:
```yaml
hostname: "${HOSTNAME:-zpan-downloader}"
```
On hosts where `HOSTNAME` is not exported, pass it when starting compose:
```sh
HOSTNAME="$(hostname)" docker compose -f deploy/docker-compose.yml up -d
```
If the downloader has already registered with a generated container hostname, change the hostname before registering a fresh downloader. The heartbeat hostname updates after restart, but the display name shown in the admin table is the name captured at registration time.
## Turso (libSQL) opt-in
Set `TURSO_DATABASE_URL` to switch from local SQLite to a Turso (or self-hosted libSQL) database. `TURSO_AUTH_TOKEN` is required for remote URLs; it can be omitted for local `file://` URLs.