From bb01311a8a0d10bf9c08c43328f3a8a89ab6ca2c Mon Sep 17 00:00:00 2001 From: francy51 Date: Tue, 24 Feb 2026 11:00:13 -0500 Subject: [PATCH] avoid coolify host-port collisions by exposing app port internally --- .env.example | 2 ++ README.md | 3 ++- docker-compose.override.yml | 4 ++++ docker-compose.yml | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 docker-compose.override.yml diff --git a/.env.example b/.env.example index 9edf9eb..d75551a 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,7 @@ # Optional API override. Leave empty to use same-origin internal API routes. NEXT_PUBLIC_API_URL= + +# Local docker host port (used by docker-compose.override.yml) APP_PORT=3000 # OpenClaw / ZeroClaw (OpenAI-compatible) diff --git a/README.md b/README.md index 367b5cb..021d527 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ cp .env.example .env docker compose up --build -d ``` -Default app URL: `http://localhost:3000` (override with `APP_PORT` in `.env`). +For local Docker, host port mapping comes from `docker-compose.override.yml` (default `http://localhost:3000`, configurable via `APP_PORT`). +For Coolify/remote Docker Compose, only container port `3000` is exposed internally (no fixed host port bind), avoiding host port collisions. Runtime data persists in the `app_data` volume (`/app/data` in container). ## Environment diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..0c5c640 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,4 @@ +services: + app: + ports: + - '${APP_PORT:-3000}:3000' diff --git a/docker-compose.yml b/docker-compose.yml index 7120080..c349c9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,8 +22,8 @@ services: interval: 30s timeout: 10s retries: 3 - ports: - - '${APP_PORT:-3000}:3000' + expose: + - "3000" volumes: - app_data:/app/data