-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
112 lines (106 loc) · 3.95 KB
/
Copy pathdocker-compose.yml
File metadata and controls
112 lines (106 loc) · 3.95 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# =============================================================================
# Nodal AI — Docker Compose stack
#
# Services:
# stellar-quickstart — local Stellar network (Horizon + Soroban RPC)
# agent — Nodal AI backend (connects to quickstart)
#
# Usage:
# docker compose up --build # start everything
# docker compose up stellar-quickstart # local network only
# docker compose run --rm agent npm run test:ts # run TS tests in container
# =============================================================================
version: "3.9"
services:
# ── Local Stellar network ────────────────────────────────────────────────────
stellar-quickstart:
image: stellar/quickstart:latest
container_name: nodal-stellar
platform: linux/amd64 # quickstart only ships amd64
ports:
- "8000:8000" # Horizon REST API
- "8001:8001" # Soroban RPC
environment:
NETWORK: local # isolated local network, no real funds
command: >
--local
--enable-soroban-rpc
--soroban-rpc-port 8001
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000"]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s
networks:
- nodal-net
# ── Nodal AI agent ───────────────────────────────────────────────────────────
agent:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: nodal-agent
depends_on:
stellar-quickstart:
condition: service_healthy
environment:
# Point to the local quickstart network
STELLAR_NETWORK: local
HORIZON_URL: http://stellar-quickstart:8000
SOROBAN_RPC_URL: http://stellar-quickstart:8001
# Override these via a .env file or CI secrets — never hardcode real keys
AGENT_SECRET_KEY: ${AGENT_SECRET_KEY:?AGENT_SECRET_KEY is required}
X402_ASSET_CODE: ${X402_ASSET_CODE:-USDC}
X402_ASSET_ISSUER: ${X402_ASSET_ISSUER:?X402_ASSET_ISSUER is required}
AGENT_SPENDING_LIMIT: ${AGENT_SPENDING_LIMIT:-100}
MAX_RETRIES: ${MAX_RETRIES:-3}
RETRY_DELAY_MS: ${RETRY_DELAY_MS:-1500}
NODE_ENV: production
ports:
- "3000:3000"
healthcheck:
test: ["CMD-SHELL", "node -e \"require('./dist/backend/config')\" || exit 1"]
interval: 30s
timeout: 10s
retries: 3
security_opt:
- "no-new-privileges:true"
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
restart: unless-stopped
networks:
- nodal-net
# Mount WASM contract at runtime (optional: already baked into image)
# volumes:
# - ./contracts/escrow:/app/contracts/escrow:ro
# ── Integration test runner (one-shot, not started by default) ───────────────
test-runner:
build:
context: .
dockerfile: Dockerfile
target: node-builder # has devDeps + source
container_name: nodal-test-runner
profiles:
- test # only starts with: docker compose --profile test up
depends_on:
stellar-quickstart:
condition: service_healthy
environment:
STELLAR_NETWORK: local
HORIZON_URL: http://stellar-quickstart:8000
SOROBAN_RPC_URL: http://stellar-quickstart:8001
AGENT_SECRET_KEY: ${AGENT_SECRET_KEY:-process.env.AGENT_SECRET_KEY}
X402_ASSET_CODE: USDC
X402_ASSET_ISSUER: ${X402_ASSET_ISSUER:-GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN}
AGENT_SPENDING_LIMIT: "100"
MAX_RETRIES: "3"
RETRY_DELAY_MS: "100"
command: npm run test:ts
networks:
- nodal-net
networks:
nodal-net:
driver: bridge