forked from Maki-Zeninn/stellar-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (99 loc) · 4.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (99 loc) · 4.03 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
# ── stellar-router local development stack ────────────────────────────────────
#
# Usage:
# docker compose up # start everything
# docker compose run tests # run unit tests only
# docker compose run wasm # build WASM contract artifacts
#
# The metrics stack (exporter + Prometheus + Grafana) mirrors the setup in
# metrics/docker-compose.yml but wires the exporter to the local build.
services:
# ── API server ───────────────────────────────────────────────────────────────
api-server:
build:
context: ./api-server
dockerfile: Dockerfile
environment:
LISTEN_ADDR: 0.0.0.0:8080
SOROBAN_RPC_URL: ${SOROBAN_RPC_URL:-https://soroban-testnet.stellar.org}
ROUTER_EXECUTION_CONTRACT_ID: ${ROUTER_EXECUTION_CONTRACT_ID:-}
ROUTER_CORE_CONTRACT_ID: ${ROUTER_CORE_CONTRACT_ID:-}
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
profiles: ["api"]
# ── Unit tests ──────────────────────────────────────────────────────────────
tests:
build:
context: .
target: test
volumes:
- cargo-cache:/usr/local/cargo/registry
- target-cache:/app/target
profiles: ["tests"]
# ── WASM contract build ─────────────────────────────────────────────────────
wasm:
build:
context: .
target: wasm
volumes:
- cargo-cache:/usr/local/cargo/registry
- target-cache:/app/target
- ./artifacts:/app/target/wasm32-unknown-unknown/release
profiles: ["wasm"]
# ── Metrics exporter ────────────────────────────────────────────────────────
metrics-exporter:
build:
context: .
target: metrics
environment:
ROUTER_RPC_URL: ${ROUTER_RPC_URL:-https://soroban-testnet.stellar.org}
ROUTER_CORE_CONTRACT_ID: ${ROUTER_CORE_CONTRACT_ID:-}
ROUTER_MIDDLEWARE_CONTRACT_ID: ${ROUTER_MIDDLEWARE_CONTRACT_ID:-}
ROUTER_REGISTRY_CONTRACT_ID: ${ROUTER_REGISTRY_CONTRACT_ID:-}
ROUTER_SCRAPE_INTERVAL_SECS: ${ROUTER_SCRAPE_INTERVAL_SECS:-15}
ports:
- "9090:9090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
depends_on:
- prometheus
# ── Prometheus ───────────────────────────────────────────────────────────────
prometheus:
image: prom/prometheus:v2.51.2
volumes:
- ./metrics/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
ports:
- "9091:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
# ── Grafana ──────────────────────────────────────────────────────────────────
grafana:
image: grafana/grafana:10.4.2
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana-data:/var/lib/grafana
- ./metrics/dashboards:/var/lib/grafana/dashboards:ro
- ./metrics/provisioning:/etc/grafana/provisioning:ro
ports:
- "3000:3000"
depends_on:
- prometheus
volumes:
cargo-cache:
target-cache:
prometheus-data:
grafana-data: