-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
433 lines (414 loc) · 11.7 KB
/
docker-compose.yml
File metadata and controls
433 lines (414 loc) · 11.7 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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
services:
rivet-server:
build:
context: ../..
dockerfile: docker/universal/Dockerfile
target: server-full
platform: linux/amd64
restart: unless-stopped
command: /usr/bin/rivet-server start
environment:
- RUST_BACKTRACE=1
- RUST_LOG_ANSI_COLOR=1
- RIVET_OTEL_ENABLED=1
- RIVET_OTEL_SAMPLER_RATIO=1
- RIVET_OTEL_ENDPOINT=http://otel-collector:4317
- RUST_LOG=debug,hyper=info
stop_grace_period: 0s
ports:
# API
- "6420:6420"
# API edge
- "6421:6421"
# Pegboard
- "6422:6422"
depends_on:
cockroachdb:
condition: service_healthy
redis:
condition: service_healthy
clickhouse:
condition: service_healthy
nats:
condition: service_healthy
seaweedfs:
condition: service_healthy
vector-server:
condition: service_started
volumes:
- ./rivet-server/config.jsonc:/etc/rivet-server/config.jsonc:ro
networks:
- rivet-network
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:6430/health/liveness"]
interval: 2s
timeout: 10s
retries: 10
# Initial SQL migrations sometimes take time to run
start_period: 30s
rivet-edge-server:
build:
context: ../..
dockerfile: docker/universal/Dockerfile
target: edge-server
platform: linux/amd64
restart: unless-stopped
command: /usr/bin/rivet-edge-server start --skip-provision
environment:
- RUST_BACKTRACE=1
- RUST_LOG_ANSI_COLOR=1
- RIVET_OTEL_ENABLED=1
- RIVET_OTEL_SAMPLER_RATIO=1
- RIVET_SERVICE_NAME=rivet-edge
- RIVET_OTEL_ENDPOINT=http://otel-collector:4317
- RUST_LOG=debug,hyper=info
stop_grace_period: 0s
ports:
# API
- "6423:6423"
depends_on:
rivet-server:
condition: service_healthy
cockroachdb:
condition: service_healthy
redis:
condition: service_healthy
nats:
condition: service_healthy
seaweedfs:
condition: service_healthy
vector-server:
condition: service_started
volumes:
- ./rivet-edge-server/config.jsonc:/etc/rivet-server/config.jsonc:ro
- sqlite-data:/root/.local/share/rivet-sqlite:rw
networks:
- rivet-network
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:6430/health/liveness"]
interval: 2s
timeout: 10s
retries: 10
rivet-shell:
build:
context: ../..
dockerfile: docker/universal/Dockerfile
target: server-full
platform: linux/amd64
restart: unless-stopped
command: sleep infinity
environment:
- RUST_BACKTRACE=1
stop_grace_period: 0s
volumes:
- ./rivet-server:/etc/rivet-server:ro
networks:
- rivet-network
rivet-edge-shell:
build:
context: ../..
dockerfile: docker/universal/Dockerfile
target: edge-server
platform: linux/amd64
restart: unless-stopped
command: sleep infinity
environment:
- RUST_BACKTRACE=1
stop_grace_period: 0s
volumes:
- ./rivet-edge-server:/etc/rivet-server:ro
- sqlite-data:/root/.local/share/rivet-sqlite:rw
networks:
- rivet-network
rivet-guard:
build:
context: ../..
dockerfile: docker/universal/Dockerfile
target: rivet-guard
platform: linux/amd64
restart: unless-stopped
command: /usr/bin/rivet-guard
environment:
- RUST_LOG=debug
- RUST_BACKTRACE=1
- RUST_LOG_ANSI_COLOR=1
- RIVET_OTEL_ENABLED=1
- RIVET_OTEL_SAMPLER_RATIO=1
- RIVET_SERVICE_NAME=rivet-guard
- RIVET_OTEL_ENDPOINT=http://otel-collector:4317
- RUST_LOG=debug,hyper=info
stop_grace_period: 0s
ports:
# HTTP
- "7080:7080"
# HTTPS
- "7443:7443"
# Enable TCP & UDP port ranges.
#
# Corresponds to `server.rivet.guard.min_ingress_port_tcp` and
# `actor.network.wan_port_range_max` in `rivet-server/config.jsonc`.
#
# We only reserve 100 ports instead of the default 22,000 since each
# individual port converts to an iptable rule when using Docker, which
# can cause unexpected side effects. This limits the number of actors
# using host networking to 100.
- "7500-7599:7500-7599"
depends_on:
rivet-server:
condition: service_healthy
cockroachdb:
condition: service_healthy
redis:
condition: service_healthy
nats:
condition: service_healthy
seaweedfs:
condition: service_healthy
vector-server:
condition: service_started
volumes:
- ./rivet-guard/config.jsonc:/etc/rivet-server/config.jsonc:ro
- ./rivet-guard/tls/:/etc/rivet-server/tls/:ro
- sqlite-data:/root/.local/share/rivet-sqlite:rw
networks:
- rivet-network
cockroachdb:
restart: unless-stopped
image: cockroachdb/cockroach:v24.2.3
command: start-single-node --insecure
volumes:
- cockroach-data:/cockroach/cockroach-data
networks:
- rivet-network
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/health?ready=1"]
interval: 2s
timeout: 10s
retries: 10
rivet-client:
build:
context: ../..
dockerfile: docker/universal/Dockerfile
target: client-full
# TODO(RVT-4168): Compile libfdb from scratch for ARM
platform: linux/amd64
restart: unless-stopped
command: -c /etc/rivet-client/config.jsonc
# entrypoint: entrypoint.sh
# Required for runc & cnitool to operate
privileged: true
environment:
- RUST_BACKTRACE=1
- RUST_LOG_ANSI_COLOR=1
- RIVET_OTEL_ENABLED=1
- RIVET_OTEL_SAMPLER_RATIO=1
- RIVET_SERVICE_NAME=rivet-client
- RIVET_OTEL_ENDPOINT=http://otel-collector:4317
- RUST_LOG=debug,hyper=info
stop_grace_period: 0s
depends_on:
# HACK: rivet-server dependency since we need to do a DNS lookup in entrypoint.sh for the iptables chain
rivet-server:
condition: service_healthy
rivet-edge-server:
condition: service_healthy
foundationdb:
condition: service_healthy
volumes:
# - ./rivet-client/entrypoint.sh:/usr/local/bin/entrypoint.sh:ro
- ./rivet-client/config.jsonc:/etc/rivet-client/config.jsonc:ro
- client-data:/var/lib/rivet-client
ports:
# Enable host networking for actors
#
# Corresponds to `actor.network.wan_port_range_min` and
# `actor.network.wan_port_range_max` in `rivet-client/config.jsonc`.
#
# We only reserve 100 ports instead of the default 22,000. See
# rivet-guard for explanation.
- "7600-7699:7600-7699"
# cAdvisor metrics endpoint
- "7780:7780"
networks:
- rivet-network
redis:
restart: unless-stopped
image: bitnami/valkey:8.0.1
# TODO: Remove root user
user: root
volumes:
- redis-data:/data
command: redis-server --requirepass password --save 60 1 --appendonly yes
networks:
- rivet-network
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 10s
retries: 10
clickhouse:
restart: unless-stopped
image: clickhouse/clickhouse-server:25.1.5
volumes:
- clickhouse-data:/var/lib/clickhouse
- ./clickhouse/config.xml:/etc/clickhouse-server/config.d/config.xml
- ./clickhouse/users.xml:/etc/clickhouse-server/users.d/users.xml
- ./clickhouse/init:/docker-entrypoint-initdb.d
environment:
# Run migrations on startup
- CLICKHOUSE_ALWAYS_RUN_INITDB_SCRIPTS=true
# Configured in users.xml
- CLICKHOUSE_USER=system
- CLICKHOUSE_PASSWORD=default
networks:
- rivet-network
ports:
- "9300:9300"
- "9301:9301"
healthcheck:
test: ["CMD", "clickhouse-client", "--password", "default", "--query", "SELECT 1"]
interval: 2s
timeout: 10s
retries: 10
nats:
restart: unless-stopped
image: nats:2.10.22-scratch
networks:
- rivet-network
ports:
- "4222:4222"
healthcheck:
test: ["CMD", "nats-server", "--health"]
interval: 2s
timeout: 10s
retries: 10
seaweedfs:
restart: unless-stopped
image: chrislusf/seaweedfs:3.79
# TODO: Remove root user
user: root
# `raftHashicorp` speeds up initial leader election
command: |
server \
-dir /var/lib/seaweedfs \
-master.raftBootstrap -master.raftHashicorp \
-s3 -s3.config /etc/seaweedfs/s3.json -s3.port=9000 -s3.allowEmptyFolder=false -s3.allowDeleteBucketNotEmpty=false
volumes:
- ./seaweedfs:/etc/seaweedfs:ro
- seaweedfs-data:/var/lib/seaweedfs
ports:
# S3
- "9000:9000"
networks:
- rivet-network
healthcheck:
test: ["CMD", "nc", "-z", "127.0.0.1", "9000"]
interval: 2s
timeout: 10s
foundationdb:
restart: unless-stopped
# See docs-internal/infrastructure/fdb/AVX.md
image: foundationdb/foundationdb:7.1.60
platform: linux/amd64
entrypoint: ["/usr/bin/tini", "-g", "--", "/usr/local/bin/entrypoint.sh"]
volumes:
- ./foundationdb/entrypoint.sh:/usr/local/bin/entrypoint.sh
- foundationdb-data:/var/fdb:rw
- foundationdb-storage-data:/var/fdb/data:rw
ports:
- "4500:4500"
healthcheck:
test: ["CMD", "fdbcli", "--exec", "status"]
interval: 2s
timeout: 10s
retries: 10
networks:
- rivet-network
vector-client:
restart: unless-stopped
image: timberio/vector:0.42.0-distroless-static
command: -C /etc/vector
volumes:
- ./vector-client:/etc/vector
# Mount client data to read logs
- client-data:/var/lib/rivet-client
networks:
- rivet-network
vector-server:
restart: unless-stopped
image: timberio/vector:0.42.0-distroless-static
command: -C /etc/vector
volumes:
- vector-server-data:/var/lib/vector
- ./vector-server:/etc/vector
networks:
- rivet-network
prometheus:
image: prom/prometheus:v2.41.0
volumes:
- ./prometheus:/etc/prometheus
ports:
- "9090:9090"
networks:
- rivet-network
grafana:
image: grafana/grafana:11.5.2
volumes:
- grafana-data:/var/lib/grafana
- ./grafana/grafana.ini:/etc/grafana/grafana.ini
- ./grafana/provisioning:/etc/grafana/provisioning
- ./grafana/dashboards:/var/lib/grafana/dashboards
ports:
# 3000 is a common port, so we use 3100 instead
- "3100:3000"
networks:
- rivet-network
environment:
- GF_INSTALL_PLUGINS=grafana-clickhouse-datasource
frontend-hub:
image: node:22-bullseye
restart: unless-stopped
working_dir: /app/frontend/apps/hub
command: /bin/bash /etc/frontend-hub/entrypoint.sh
environment:
- NODE_ENV=development
ports:
- "5080:5080"
volumes:
- ../..:/app:rw
- ./frontend-hub/entrypoint.sh:/etc/frontend-hub/entrypoint.sh:ro
networks:
- rivet-network
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
restart: unless-stopped
command: --config=/etc/otel/config.yaml
volumes:
- ./otel-collector/config.yaml:/etc/otel/config.yaml:ro
environment:
- CLICKHOUSE_PASSWORD=default
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "8888:8888" # Metrics
depends_on:
clickhouse:
condition: service_healthy
networks:
- rivet-network
networks:
rivet-network:
driver: bridge
volumes:
client-data:
cockroach-data:
redis-data:
clickhouse-data:
seaweedfs-data:
vector-server-data:
foundationdb-data:
foundationdb-storage-data:
sqlite-data:
grafana-data: