Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

fix(docker): bind compose Postgres and Redis to loopback (#688)

Animesh Kumar2d7578e41afe
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index cc75166fc..1a5309636 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -214,7 +214,7 @@ pnpm smoke # build, wait for healthy services, check /healthz and UI
pnpm smoke:down
```
-Open [http://localhost:8791](http://localhost:8791). Credentials come from `packages/trueforge/.env`. Host ports are offset from local dev so they do not collide: Postgres `:5433`, Redis `:6380`, app `:8791`.
+Open [http://localhost:8791](http://localhost:8791). Credentials come from `packages/trueforge/.env`. The app is on host `:8791` (offset from local `pnpm dev` on `:8790`); Postgres and Redis stay on the compose network only.
## Generated code - do not edit by hand
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 7e9ccc45a..67c2c0ea5 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -8,8 +8,9 @@ services:
env_file:
- path: packages/trueforge/.env
required: true
+ # Loopback-only: this stack is for local use, and the port carries a database.
ports:
- - '5432:5432'
+ - '127.0.0.1:5432:5432'
volumes:
- ./data/dev/postgres:/var/lib/postgresql/data
healthcheck:
@@ -23,8 +24,9 @@ services:
# turn cancel via request-reply).
redis:
image: redis:7-alpine
+ # Loopback-only: Redis runs unauthenticated and carries live peering traffic.
ports:
- - '6379:6379'
+ - '127.0.0.1:6379:6379'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
diff --git a/docker-compose.yml b/docker-compose.yml
index 577286c56..df226c641 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,6 +1,6 @@
# Full-stack smoke test. Reads packages/trueforge/.env for secrets and
-# credentials; host ports and in-network DB/Redis targets are opinionated here
-# so they do not collide with or inherit host-dev values.
+# credentials; in-network DB/Redis targets are opinionated here so they do not
+# inherit host-dev localhost values. Postgres/Redis stay off the host network.
name: trueforge
services:
@@ -9,9 +9,6 @@ services:
env_file:
- path: packages/trueforge/.env
required: true
- # Host 5433 avoids conflict with docker-compose.dev.yml on 5432.
- ports:
- - '5433:5432'
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
@@ -25,9 +22,6 @@ services:
# turn cancel via request-reply).
redis:
image: redis:7-alpine
- # Host 6380 avoids conflict with docker-compose.dev.yml on 6379.
- ports:
- - '6380:6379'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s