Skip to content

Commit 67c901e

Browse files
omer9564claude
andcommitted
fix(examples): mount config-compose.yaml so docker compose up reaches NATS
The examples stack mounted config.yaml (server_url=localhost:4222) into the in-container opa service, so localhost resolved to the OPA container and the plugin couldn't reach the `nats` service. Mount config-compose.yaml (nats://nats:4222) instead and drop the unused NATS_URL env. Addresses review comments: - #4 (comment) (@zeevmoney) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent eecf98e commit 67c901e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

examples/opa-nats/docker-compose.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ services:
121121
ports:
122122
- "8181:8181"
123123
volumes:
124-
- ./config.yaml:/config/config.yaml
124+
# In-compose OPA must reach NATS via the service name, so mount the
125+
# compose config (server_url=nats://nats:4222), NOT config.yaml's
126+
# host-friendly localhost default — otherwise `localhost:4222` resolves to
127+
# the OPA container itself and the plugin can't reach NATS.
128+
- ./config-compose.yaml:/config/config.yaml
125129
- ./rego:/policies
126-
environment:
127-
- NATS_URL=nats://nats:4222
128130
networks:
129131
- nats-net
130132

0 commit comments

Comments
 (0)