Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
323 lines (302 loc) · 12.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
323 lines (302 loc) · 12.5 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# Scavngr local development environment
#
# This is the single base Compose file. Optional stacks are gated behind
# Compose profiles so developers never have to guess a `-f` combination:
#
# docker compose up -d # core stack only
# docker compose --profile monitoring up -d # + Prometheus/Grafana/Alertmanager
# docker compose --profile logging up -d # + Elasticsearch/Kibana/Logstash/Filebeat
# docker compose --profile search up -d # + Elasticsearch (search only)
# docker compose --profile monitoring --profile logging up -d
#
# Local development overrides live in docker-compose.dev.yml:
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
#
# Stellar quickstart UI: http://localhost:8000
# Frontend: http://localhost:5173
# Backend API: http://localhost:8080
# Indexer: http://localhost:3001
# Redis: localhost:6379
# Postgres: localhost:5432
# Prometheus: http://localhost:9090 (profile: monitoring)
# Grafana: http://localhost:3000 (profile: monitoring)
# Alertmanager: http://localhost:9093 (profile: monitoring)
# Kibana: http://localhost:5601 (profile: logging)
# Jaeger UI: http://localhost:16686 (profile: logging)
name: scavngr-dev
services:
# ── Stellar standalone network ──────────────────────────────────────────────
stellar:
image: stellar/quickstart:latest
command: --standalone --enable-soroban-rpc
ports:
- "8000:8000" # Horizon + Soroban RPC
environment:
NETWORK: standalone
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
# ── PostgreSQL ──────────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: scavngr
POSTGRES_PASSWORD: scavngr_dev
POSTGRES_DB: scavngr
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/seed.sql:/docker-entrypoint-initdb.d/seed.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U scavngr"]
interval: 5s
timeout: 3s
retries: 10
# ── Redis ───────────────────────────────────────────────────────────────────
redis:
image: redis:7-alpine
command: redis-server --save "" --appendonly no
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# ── Backend (Rust / Actix-web) ──────────────────────────────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: dev
ports:
- "8080:8080"
environment:
RUST_LOG: debug
DATABASE_URL: postgresql://scavngr:scavngr_dev@postgres:5432/scavngr
REDIS_URL: redis://redis:6379
STORAGE_PATH: /tmp
AWS_REGION: us-east-1
volumes:
- ./backend:/app
- cargo_cache:/usr/local/cargo/registry
- target_cache:/app/target
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8080/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
# ── Indexer (Node.js / TypeScript) ─────────────────────────────────────────
indexer:
build:
context: ./indexer
dockerfile: Dockerfile
target: dev
ports:
- "3001:3001"
environment:
DATABASE_URL: postgresql://scavngr:scavngr_dev@postgres:5432/scavngr
REDIS_URL: redis://redis:6379
STELLAR_RPC_URL: http://stellar:8000/soroban/rpc
NETWORK_PASSPHRASE: "Standalone Network ; February 2017"
CONTRACT_ID: ${CONTRACT_ID:-}
START_LEDGER: "0"
POLL_INTERVAL_MS: "2000"
volumes:
- ./indexer/src:/app/src
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
stellar:
condition: service_healthy
# ── Frontend (Vite / React) ─────────────────────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: dev
ports:
- "5173:5173"
environment:
VITE_CONTRACT_ID: ${CONTRACT_ID:-}
VITE_NETWORK: STANDALONE
VITE_RPC_URL: http://localhost:8000/soroban/rpc
VITE_FIREBASE_API_KEY: ${VITE_FIREBASE_API_KEY:-dev-stub}
VITE_FIREBASE_AUTH_DOMAIN: ${VITE_FIREBASE_AUTH_DOMAIN:-dev-stub}
VITE_FIREBASE_PROJECT_ID: ${VITE_FIREBASE_PROJECT_ID:-dev-stub}
VITE_FIREBASE_STORAGE_BUCKET: ${VITE_FIREBASE_STORAGE_BUCKET:-dev-stub}
VITE_FIREBASE_MESSAGING_SENDER_ID: ${VITE_FIREBASE_MESSAGING_SENDER_ID:-dev-stub}
VITE_FIREBASE_APP_ID: ${VITE_FIREBASE_APP_ID:-dev-stub}
VITE_FIREBASE_MEASUREMENT_ID: ${VITE_FIREBASE_MEASUREMENT_ID:-dev-stub}
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
depends_on:
- backend
- indexer
# ════════════════════════════════════════════════════════════════════════════
# Profile: monitoring
# ════════════════════════════════════════════════════════════════════════════
# ── Prometheus ──────────────────────────────────────────────────────────────
prometheus:
image: prom/prometheus:latest
profiles: ["monitoring"]
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./monitoring/alert-rules.yml:/etc/prometheus/alert-rules.yml:ro
- prometheus_data:/prometheus
depends_on:
- backend
restart: unless-stopped
# ── Grafana ─────────────────────────────────────────────────────────────────
grafana:
image: grafana/grafana:latest
profiles: ["monitoring"]
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
restart: unless-stopped
# ── Alertmanager ────────────────────────────────────────────────────────────
alertmanager:
image: prom/alertmanager:latest
profiles: ["monitoring"]
ports:
- "9093:9093"
volumes:
- ./monitoring/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
- alertmanager_data:/alertmanager
restart: unless-stopped
# ── Node Exporter ───────────────────────────────────────────────────────────
node-exporter:
image: prom/node-exporter:latest
profiles: ["monitoring"]
command:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --path.rootfs=/host/root
ports:
- "9100:9100"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/host/root:ro,rslave
restart: unless-stopped
# ════════════════════════════════════════════════════════════════════════════
# Profile: logging
# ════════════════════════════════════════════════════════════════════════════
# ── Elasticsearch ───────────────────────────────────────────────────────────
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.0
profiles: ["logging", "search"]
environment:
discovery.type: single-node
xpack.security.enabled: "false"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
ports:
- "9200:9200"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 20
start_period: 30s
restart: unless-stopped
# ── Kibana ──────────────────────────────────────────────────────────────────
kibana:
image: docker.elastic.co/kibana/kibana:8.13.0
profiles: ["logging"]
environment:
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
elasticsearch:
condition: service_healthy
restart: unless-stopped
# ── Logstash ────────────────────────────────────────────────────────────────
logstash:
image: docker.elastic.co/logstash/logstash:8.13.0
profiles: ["logging"]
volumes:
- ./logging/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
ports:
- "5044:5044"
- "5000:5000/tcp"
- "5000:5000/udp"
environment:
LS_JAVA_OPTS: "-Xms256m -Xmx256m"
depends_on:
elasticsearch:
condition: service_healthy
restart: unless-stopped
# ── Filebeat ────────────────────────────────────────────────────────────────
filebeat:
image: docker.elastic.co/beats/filebeat:8.13.0
profiles: ["logging"]
user: root
command: filebeat -e -strict.perms=false
volumes:
- ./logging/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- logstash
restart: unless-stopped
# ── Jaeger (tracing) ────────────────────────────────────────────────────────
jaeger:
image: jaegertracing/all-in-one:latest
profiles: ["logging"]
environment:
COLLECTOR_OTLP_ENABLED: "true"
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
restart: unless-stopped
# ── Elasticsearch index setup (one-shot) ────────────────────────────────────
es-setup:
image: curlimages/curl:latest
profiles: ["logging", "search"]
depends_on:
elasticsearch:
condition: service_healthy
volumes:
- ./logging/es-setup.sh:/es-setup.sh:ro
entrypoint: ["/bin/sh", "/es-setup.sh"]
restart: "no"
volumes:
postgres_data:
cargo_cache:
target_cache:
prometheus_data:
grafana_data:
alertmanager_data:
elasticsearch_data: