From a78ba4d55a135080cfe1940f62b638689a87bb77 Mon Sep 17 00:00:00 2001 From: germondai Date: Sun, 5 Jul 2026 18:05:34 +0200 Subject: [PATCH 1/3] fix(compose): make API host port configurable via PORT env var --- docker-compose.full.yml | 2 +- docker-compose.minimal.yml | 2 +- docker-compose.prod.yml | 2 +- docker-compose.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.full.yml b/docker-compose.full.yml index cdcd350..3fbfd14 100644 --- a/docker-compose.full.yml +++ b/docker-compose.full.yml @@ -14,7 +14,7 @@ services: image: ghcr.io/germondai/trawl:latest restart: unless-stopped ports: - - "${PORT_API:-8191}:8191" + - "${PORT:-8191}:8191" environment: - REDIS_URL=redis://redis:6379 - BROWSER_POOL_SIZE=${BROWSER_POOL_SIZE:-3} diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index 59a8c4a..2cdd054 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -2,7 +2,7 @@ services: trawl: image: ghcr.io/germondai/trawl:latest ports: - - "8191:8191" + - "${PORT:-8191}:8191" shm_size: 1gb environment: BROWSER_POOL_SIZE: 1 diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index a779972..8624156 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -9,7 +9,7 @@ services: image: ghcr.io/germondai/trawl:latest restart: always ports: - - "8191:8191" + - "${PORT:-8191}:8191" shm_size: 1gb mem_limit: 3g environment: diff --git a/docker-compose.yml b/docker-compose.yml index 614f18d..fc2202a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,11 +7,11 @@ services: trawl: image: ghcr.io/germondai/trawl:latest ports: - - "8191:8191" + - "${PORT:-8191}:8191" shm_size: 1gb environment: REDIS_URL: redis://redis:6379 - BROWSER_POOL_SIZE: 3 + BROWSER_POOL_SIZE: ${BROWSER_POOL_SIZE:-3} depends_on: - redis healthcheck: From e05d9afee3cb64ab2ebad8be836598e232298610 Mon Sep 17 00:00:00 2001 From: germondai Date: Sun, 5 Jul 2026 18:06:02 +0200 Subject: [PATCH 2/3] refactor(api): rename PORT_API env var to PORT --- apps/api/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index abb1249..e2eafc3 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -4,7 +4,7 @@ import type { FlareSolverrRequest, FlareSolverrResponse, PoolStats, ScrapeReques import { Elysia } from "elysia" const REDIS_URL = process.env.REDIS_URL ?? "redis://localhost:6379" -const PORT = Number(process.env.PORT_API ?? "8191") +const PORT = Number(process.env.PORT ?? "8191") const POOL_SIZE = Number(process.env.BROWSER_POOL_SIZE ?? "3") // How long acquire() will poll for a free browser before rejecting with PoolExhaustedError. // 15s covers a full CF challenge burst with pool=3 (queue depth 7, slowest finishes at ~12s). From 9261d5d92f4bd28019e321174425fa1bdd68c8cc Mon Sep 17 00:00:00 2001 From: germondai Date: Sun, 5 Jul 2026 18:06:12 +0200 Subject: [PATCH 3/3] docs: update references to renamed PORT env var --- .env.example | 2 +- README.md | 2 +- apps/docs/api-reference/overview.md | 2 +- apps/docs/getting-started/configuration.md | 13 ++++++++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 78ad16e..bd35d35 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ BROWSER_POOL_SIZE=5 SESSION_TTL_SECONDS=3600 PROXY_URL= RESIDENTIAL_PROXY_URL= -PORT_API=8191 +PORT=8191 PORT_WEB=3000 PORT_DOCS=3001 diff --git a/README.md b/README.md index aa5efb0..01cb5bb 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Synology note: many Synology NAS units (DSM 7.x on J4125 / older hardware) ship | `REDIS_URL` | `redis://localhost:6379` | Redis connection string | | `RESIDENTIAL_PROXY_URL` | — | Enables Tier 4 proxy escalation | | `STT_URL` | — | Local Whisper endpoint for reCAPTCHA (optional) | -| `PORT_API` | `8191` | API listen port | +| `PORT` | `8191` | API listen port | ## Stack diff --git a/apps/docs/api-reference/overview.md b/apps/docs/api-reference/overview.md index 04ad31a..fa8998c 100644 --- a/apps/docs/api-reference/overview.md +++ b/apps/docs/api-reference/overview.md @@ -11,7 +11,7 @@ description: Base URL, content types, and response conventions. http://localhost:8191 ``` -Or wherever you've mapped `PORT_API` (default `8191`). +Or wherever you've mapped `PORT` (default `8191`). ## Authentication diff --git a/apps/docs/getting-started/configuration.md b/apps/docs/getting-started/configuration.md index 61555a8..3282051 100644 --- a/apps/docs/getting-started/configuration.md +++ b/apps/docs/getting-started/configuration.md @@ -130,11 +130,18 @@ Note: `proxy` on `/v1` is a TRAWL-specific extension — it is not part of the r ## Ports -### `PORT_API` +### `PORT` **Default:** `8191` -Port the Elysia API server listens on. Defaults to `8191` — the same port FlareSolverr and Byparr use, so you can swap TRAWL in without changing any *arr app settings. +Host port the Docker port mapping forwards to TRAWL's internal listener. Defaults to `8191` — the same port FlareSolverr and Byparr use, so you can swap TRAWL in without changing any *arr app settings. The container itself always listens on `8191` internally; `PORT` only changes the **host-side** port (e.g. `"${PORT:-8191}:8191"` in every compose file). + +To run TRAWL alongside FlareSolverr (or any other service that already binds `8191` on the host), set `PORT` in your shell or `.env` to any free port **before** running `docker compose up`: + +```bash +PORT=9191 docker compose up -d +# TRAWL reachable at http://localhost:9191, while port 8191 stays free for FlareSolverr. +``` ### `PORT_WEB` @@ -162,6 +169,6 @@ PROXY_LIST_FILE= RESIDENTIAL_PROXY_LIST_FILE= # ── Ports ───────────────────────────────────── -PORT_API=8191 +PORT=8191 PORT_WEB=3000 ```