-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.distributed.yml
More file actions
56 lines (53 loc) · 1.53 KB
/
docker-compose.distributed.yml
File metadata and controls
56 lines (53 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# DALI2 Distributed Example - Two nodes sharing one Redis
# All communication goes through the shared Redis instance (star topology).
#
# Node 1 (sensors): sensor + logger on port 8081
# Node 2 (responders): coordinator + responder on port 8082
#
# Usage:
# docker compose -f docker-compose.distributed.yml up --build
#
# Test (PowerShell):
# curl.exe -X POST http://localhost:8081/api/send -H "Content-Type: application/json" `
# -d '{\"to\":\"sensor\",\"content\":\"detect(fire, rome)\"}'
#
# Both nodes see each other's agents via the Redis AGENTS registry.
# Messages between agents on different nodes are routed through Redis LINDA channel.
services:
redis:
image: redis:7-alpine
ports:
- "6379:6379"
restart: unless-stopped
sensors:
build: .
init: true
ports:
- "8081:8080"
volumes:
- ./examples:/dali2/examples
environment:
- DALI2_NODE=sensors
- REDIS_HOST=redis
- REDIS_PORT=6379
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
command: ["8080", "examples/emergency_sensors.pl", "--name", "sensors"]
depends_on:
- redis
restart: unless-stopped
responders:
build: .
init: true
ports:
- "8082:8080"
volumes:
- ./examples:/dali2/examples
environment:
- DALI2_NODE=responders
- REDIS_HOST=redis
- REDIS_PORT=6379
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
command: ["8080", "examples/emergency_responders.pl", "--name", "responders"]
depends_on:
- redis
restart: unless-stopped