-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (91 loc) · 2.49 KB
/
docker-compose.yml
File metadata and controls
95 lines (91 loc) · 2.49 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
services:
# DynamoDB Local
dynamodb:
image: amazon/dynamodb-local:latest
command: ["-jar", "DynamoDBLocal.jar", "-inMemory", "-sharedDb"]
ports:
- "8001:8000"
healthcheck:
test: ["CMD-SHELL", "exec 3<>/dev/tcp/localhost/8000 && echo ok || exit 1"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
# Redis
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# Init: create DynamoDB table
dynamodb-init:
image: amazon/aws-cli:latest
depends_on:
dynamodb:
condition: service_healthy
environment:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
entrypoint: >
/bin/sh -c "
aws dynamodb create-table
--table-name tenant-registry
--attribute-definitions AttributeName=tenant_id,AttributeType=S
--key-schema AttributeName=tenant_id,KeyType=HASH
--billing-mode PAY_PER_REQUEST
--endpoint-url http://dynamodb:8000 2>&1 | grep -v ResourceInUseException || true
echo 'DynamoDB table ready'
"
restart: "no"
# Orchestrator
orchestrator:
build:
context: .
dockerfile: Dockerfile.orchestrator
ports:
- "8080:8080"
depends_on:
dynamodb-init:
condition: service_completed_successfully
redis:
condition: service_healthy
environment:
DYNAMODB_TABLE: tenant-registry
DYNAMODB_ENDPOINT: http://dynamodb:8000
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
REDIS_ADDR: redis:6379
K8S_NAMESPACE: tenants
S3_BUCKET: zeroclaw-tenant-state
WARM_POOL_TARGET: "0" # disable warm pool locally (no k8s)
ZEROCLAW_IMAGE: zeroclaw:latest
KATA_RUNTIME_CLASS: kata-qemu
PORT: "8080"
LEADER_ELECTION_ID: orchestrator-local
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/healthz | grep -q ok || exit 1"]
interval: 5s
timeout: 3s
retries: 5
# Router
router:
build:
context: .
dockerfile: Dockerfile.router
ports:
- "9090:9090"
depends_on:
orchestrator:
condition: service_healthy
redis:
condition: service_healthy
environment:
REDIS_ADDR: redis:6379
ORCHESTRATOR_ADDR: http://orchestrator:8080
PORT: "9090"