mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-28 15:51:29 +08:00
fix(docker): use host hostname for downloader
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user