Skip to content

Commit 06224b2

Browse files
committed
fix(api): keep container port fixed at 8080 in Compose
- set PORT=8080 in compose files and use API_PORT only for host mapping - rename api env example key from API_PORT to PORT for app config - document that API_PORT affects only the published host-side port
1 parent b919650 commit 06224b2

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

apps/api/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
API_PORT=8080
1+
PORT=8080
22
REDIS_URL=
33
DEBUG=false
44

apps/api/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pnpm api:compose
5959

6060
This uses `compose.yaml`, starts the published GHCR image from the repository root, and keeps using your existing Redis backend.
6161
If you need to override the bundled `/js` file path for a one-off run, set `SCRIPT_PATH` in the shell before starting Compose.
62+
Inside the container, the API always listens on `8080`; use `API_PORT` in the root `.env` to choose the host-side published port.
6263

6364
The production-like Compose file uses:
6465

@@ -77,6 +78,7 @@ pnpm api:compose:local
7778
This uses `compose-local.yaml`, builds the API image locally, and wires the API container to `redis://redis:6379/0`.
7879
It also defaults to the bundled in-image `/js` asset, with `SCRIPT_PATH` still available as a one-off shell override.
7980
The root `.env` file can still provide values like `API_PORT` and `DEBUG` for this workflow.
81+
Inside the container, the API still listens on `8080`; `API_PORT` only controls the host-side published port.
8082

8183
Stop the production-like Compose workflow from the repo root with:
8284

compose-local.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
context: .
66
dockerfile: apps/api/Dockerfile
77
environment:
8-
PORT: ${API_PORT:-8080}
8+
PORT: 8080
99
REDIS_URL: redis://redis:6379/0
1010
SCRIPT_PATH: ${SCRIPT_PATH:-}
1111
DEBUG: ${DEBUG:-false}

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
api:
33
image: ghcr.io/evannotfound/vercount-api:edge
44
environment:
5-
PORT: ${API_PORT:-8080}
5+
PORT: 8080
66
REDIS_URL: ${REDIS_URL:-}
77
DEBUG: ${DEBUG:-false}
88
SCRIPT_PATH: ${SCRIPT_PATH:-}

0 commit comments

Comments
 (0)