forked from astera-hq/Astera
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
178 lines (169 loc) · 6.55 KB
/
Copy pathdocker-compose.yml
File metadata and controls
178 lines (169 loc) · 6.55 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
version: '3.8'
# #445: Full local Astera development stack.
# Usage:
# docker compose up — start everything
# docker compose down -v — stop and remove all state
#
# The stellar-quickstart container must be healthy before contracts are
# deployed, and contracts must finish deploying before the frontend starts.
services:
# ── Stellar local network ──────────────────────────────────────────────────
stellar:
image: stellar/quickstart:testing
command: --local
ports:
- "8000:8000"
- "11626:11626"
volumes:
- stellar-data:/opt/stellar
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
# ── Contract builder + deployer ────────────────────────────────────────────
contracts:
build:
context: ./contracts
dockerfile: Dockerfile
volumes:
- ./contracts:/app
- contract-ids:/contract-ids
depends_on:
stellar:
condition: service_healthy
environment:
- STELLAR_RPC_URL=http://stellar:8000/soroban/rpc
- STELLAR_NETWORK_PASSPHRASE=Standalone Network ; February 2017
- HORIZON_URL=http://stellar:8000
# Deploy all contracts and write their IDs to /contract-ids/env so the
# frontend can pick them up. Falls back to tail -f /dev/null if the
# deploy script is not present (e.g. first-time checkout without scripts/).
command: >
sh -c "
if [ -f /app/scripts/deploy-local.sh ]; then
sh /app/scripts/deploy-local.sh && tail -f /dev/null
else
echo 'deploy-local.sh not found — skipping deploy, container idle'
tail -f /dev/null
fi
"
# ── Next.js frontend ───────────────────────────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
- contract-ids:/contract-ids:ro
depends_on:
stellar:
condition: service_healthy
contracts:
condition: service_started
environment:
- NEXT_PUBLIC_HORIZON_URL=http://stellar:8000
- NEXT_PUBLIC_SOROBAN_RPC_URL=http://stellar:8000/soroban/rpc
- NEXT_PUBLIC_NETWORK=local
# Contract IDs are written by the deployer; override here if needed.
- NEXT_PUBLIC_INVOICE_CONTRACT_ID=${INVOICE_CONTRACT_ID:-}
- NEXT_PUBLIC_POOL_CONTRACT_ID=${POOL_CONTRACT_ID:-}
- NEXT_PUBLIC_USDC_TOKEN_ID=${USDC_TOKEN_ID:-}
# ── Mock REST service (json-server) ───────────────────────────────────────
mock-service:
image: node:20-alpine
working_dir: /mock-service
volumes:
- ./mock-service:/mock-service
command: npx -y json-server@0.17.4 --watch db.json --port 4000 --host 0.0.0.0
ports:
- "4000:4000"
# ── Off-chain indexer ──────────────────────────────────────────────────────
indexer:
build:
context: ./indexer
dockerfile: Dockerfile
ports:
- "3001:3001"
volumes:
- ./indexer/data:/indexer/data
environment:
- HORIZON_URL=http://stellar:8000
- CONTRACT_IDS=${INVOICE_CONTRACT_ID:-},${POOL_CONTRACT_ID:-}
- POLLING_INTERVAL_MS=5000
- API_PORT=3001
- DB_PATH=/indexer/data/indexer.db
depends_on:
stellar:
condition: service_healthy
restart: unless-stopped
# ── Oracle service ─────────────────────────────────────────────────────────
oracle-service:
build:
context: ./oracle-service
dockerfile: Dockerfile
environment:
- RPC_URL=http://stellar:8000/soroban/rpc
- HORIZON_URL=http://stellar:8000
- NETWORK_PASSPHRASE=Standalone Network ; February 2017
- ORACLE_SECRET_KEY=${ORACLE_SECRET_KEY:-}
- INVOICE_CONTRACT_ID=${INVOICE_CONTRACT_ID:-}
- AUTO_VERIFY_DELAY_MS=30000
- HEALTH_PORT=8080
# #861: unset by default (legacy single-oracle mode). Set to run this
# node as one voter in the N-of-M staked oracle consensus network —
# see oracle-service/README.md for running multiple nodes locally.
- ORACLE_REGISTRY_CONTRACT_ID=${ORACLE_REGISTRY_CONTRACT_ID:-}
depends_on:
stellar:
condition: service_healthy
contracts:
condition: service_started
volumes:
- ./oracle-service:/app
- ./sdk:/sdk
healthcheck:
test: ["CMD", "node", "-e", "fetch(`http://127.0.0.1:${process.env.HEALTH_PORT || 8080}/health`).then((res) => process.exit(res.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
# ── Compliance service (#867) ──────────────────────────────────────────────
compliance-service:
build:
context: ./compliance-service
dockerfile: Dockerfile
environment:
- RPC_URL=http://stellar:8000/soroban/rpc
- HORIZON_URL=http://stellar:8000
- NETWORK_PASSPHRASE=Standalone Network ; February 2017
- COMPLIANCE_SCREENER_SECRET_KEY=${COMPLIANCE_SCREENER_SECRET_KEY:-}
- COMPLIANCE_CONTRACT_ID=${COMPLIANCE_CONTRACT_ID:-}
- POOL_CONTRACT_ID=${POOL_CONTRACT_ID:-}
- INVOICE_CONTRACT_ID=${INVOICE_CONTRACT_ID:-}
- HEALTH_PORT=8081
- COMPLIANCE_ADMIN_TOKEN=${COMPLIANCE_ADMIN_TOKEN:-}
depends_on:
stellar:
condition: service_healthy
contracts:
condition: service_started
volumes:
- ./compliance-service:/app
- ./sdk:/sdk
healthcheck:
test: ["CMD", "node", "-e", "fetch(`http://127.0.0.1:${process.env.HEALTH_PORT || 8081}/health`).then((res) => process.exit(res.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
volumes:
stellar-data:
# Shared volume so the deployer can pass contract IDs to the frontend.
contract-ids: