Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
552 lines (541 loc) · 24.9 KB
/
Copy pathdocker-compose.yml
File metadata and controls
552 lines (541 loc) · 24.9 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
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# =============================================================================
# Dakera - Single Node Quick Start
# =============================================================================
# Minimal setup: one Dakera node + MinIO storage.
# For HA cluster, use docker-compose.ha.yml instead.
#
# Usage:
# docker compose up -d
# docker compose --profile dashboard up -d # with Dashboard UI
# docker compose down
#
# Dakera v0.12.3, Dashboard 0.5.2. (v0.11 users: the previous version of this file
# is on the `release/0.11` branch.)
#
# Upgrading from v0.12.2 (or older v0.12): back up, then `docker compose pull && docker compose up -d`.
# Nothing to migrate by hand. Review the v0.12.3 behaviour changes first (server
# CHANGELOG 0.12.3): POST /ops/shutdown needs a super_admin key; four admin routes
# refuse unknown JSON fields (422); an idle keep-alive connection is closed after
# DAKERA_HTTP_HEADER_READ_TIMEOUT_SECS (30 s: a proxy in front must drop idle
# connections sooner); the server image is distroless (uid/gid 1000, no curl:
# the health check below handles both). From v0.12.1 (or v0.12.0), the v0.12.2
# notes apply too (UPGRADE.md "Upgrading from v0.12.1 to v0.12.2").
#
# Upgrading from v0.11.108 (see README "Upgrading from v0.11"):
# 1. Back up: POST /admin/backups
# 2. Check the config with the new image, against your env and data volumes
# (prints every warning the first start will give; exit 0 = would start,
# 78 = would refuse; starts nothing):
# docker compose run --rm --no-deps dakera --check-config
# 3. Upgrade: docker compose pull && docker compose up -d
#
# Going back to v0.11.108 (stop the server FIRST; `downgrade` refuses to run
# while a server uses the data; it needs MinIO up, so no --no-deps):
# docker compose stop dakera-watchdog dakera
# docker compose run --rm dakera downgrade # JSON report on stdout; exit 0 = done
# DAKERA_IMAGE=ghcr.io/dakera-ai/dakera:0.11.108 docker compose up -d # with the v0.11 file
# Docs: https://github.com/Dakera-AI/dakera/blob/main/docs/v0.12/UPGRADE.md
# =============================================================================
name: dakera
services:
# ==========================================================================
# Dakera - AI Agent Memory Platform
# ==========================================================================
dakera:
image: ${DAKERA_IMAGE:-ghcr.io/dakera-ai/dakera:0.12.3}
container_name: dakera
# DAK-9890 / FW-b5ad5a7f / DAK-9814: place the container under a systemd
# slice that sets memory.high=10G (soft cgroup-v2 backpressure). The kernel
# throttles & reclaims before the 12G hard wall (deploy.resources.limits.memory),
# giving graceful degradation instead of an OOM kill. Requires dakera-mem.slice
# on the host (see scripts/install-dakera-mem-slice.sh — re-run after update).
# No-op if the slice is absent.
cgroup_parent: dakera-mem.slice
ports:
- "127.0.0.1:${DAKERA_PORT:-3000}:3000"
- "127.0.0.1:${DAKERA_GRPC_PORT:-50051}:50051"
environment:
- RUST_LOG=${RUST_LOG:-info}
- DAKERA_HOST=0.0.0.0
- DAKERA_PORT=3000
- DAKERA_GRPC_PORT=50051
- DAKERA_STORAGE=s3
- DAKERA_S3_ENDPOINT=http://minio:9000
- DAKERA_S3_BUCKET=dakera
- AWS_ACCESS_KEY_ID=${MINIO_ROOT_USER:-minioadmin}
- AWS_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD:-minioadmin}
- DAKERA_S3_REGION=us-east-1
# Hot-tier byte budget (tiered storage). A bare number below 10 million is a
# vector COUNT (the default is 100000 vectors); a unit suffix makes it bytes.
- DAKERA_L1_CACHE_SIZE=${DAKERA_L1_CACHE_SIZE:-512MB}
# The data root: write-ahead log, knowledge graph ({root}/graph.db), hot tier
# ({root}/hot), warm tier ({root}/cache/warm) all derive from it. Replaces
# v0.11's DAKERA_L2_CACHE_PATH, which v0.12 no longer reads.
- DAKERA_STORAGE_PATH=/data
# Tiered storage (L1 hot → L2 warm → L3 cold via S3)
- DAKERA_TIERED_STORAGE=${DAKERA_TIERED_STORAGE:-true}
- DAKERA_HOT_TO_WARM_SECS=${DAKERA_HOT_TO_WARM_SECS:-3600}
- DAKERA_WARM_TO_COLD_SECS=${DAKERA_WARM_TO_COLD_SECS:-86400}
- DAKERA_AUTO_TIER=${DAKERA_AUTO_TIER:-true}
- DAKERA_TIER_CHECK_INTERVAL_SECS=${DAKERA_TIER_CHECK_INTERVAL_SECS:-300}
# The tiered EMBEDDING engine (static fast write, background re-embed; not tiered
# storage above). It always embeds with bge-large and ignores DAKERA_MODEL, and late
# interaction is refused under it: the v0.12 feature overlays that change the model
# or the lane (multilingual, late-interaction, vision) set it to 0.
- DAKERA_TIERED=${DAKERA_TIERED:-1}
- DAKERA_SEARCH_MODE=${DAKERA_SEARCH_MODE:-hybrid}
- DAKERA_MAX_BODY_SIZE=${DAKERA_MAX_BODY_SIZE:-524288000}
- DAKERA_REQUEST_TIMEOUT=${DAKERA_REQUEST_TIMEOUT:-600}
- DAKERA_AUTH_ENABLED=${DAKERA_AUTH_ENABLED:-true}
- DAKERA_ROOT_API_KEY=${DAKERA_ROOT_API_KEY:?Set DAKERA_ROOT_API_KEY in .env (see .env.example)}
- HF_TOKEN=${HF_TOKEN:-}
- HUGGING_FACE_HUB_TOKEN=${HUGGING_FACE_HUB_TOKEN:-}
# Model downloads behind a proxy / mirror, or none at all (air-gapped). All
# empty = unset = the Hugging Face Hub, directly. See .env.example, "Model
# downloads", and docs/features-v0.12.md, "The model store".
# Settings documented in .env.example. Compose passes ONLY what is listed here (a
# variable in .env that is not, never reaches the container), so each is passed
# empty = unset = the server's default. DAKERA_ENCRYPTION_KEY set here turns
# encryption at rest on.
- DAKERA_ENCRYPTION_KEY=${DAKERA_ENCRYPTION_KEY:-}
- DAKERA_HYBRID_FETCH_MULT=${DAKERA_HYBRID_FETCH_MULT:-}
- DAKERA_BM25_K1=${DAKERA_BM25_K1:-}
- DAKERA_BM25_B=${DAKERA_BM25_B:-}
- DAKERA_BM25_DELTA=${DAKERA_BM25_DELTA:-}
- DAKERA_RRF_K=${DAKERA_RRF_K:-}
- DAKERA_FUSION_STRATEGY=${DAKERA_FUSION_STRATEGY:-}
- DAKERA_TEMPORAL_RERANK_GAMMA=${DAKERA_TEMPORAL_RERANK_GAMMA:-}
- DAKERA_ADAPTIVE_WVEC_BOOST=${DAKERA_ADAPTIVE_WVEC_BOOST:-}
- DAKERA_ADAPTIVE_WVEC_THRESHOLD=${DAKERA_ADAPTIVE_WVEC_THRESHOLD:-}
- DAKERA_PPR_FUSION=${DAKERA_PPR_FUSION:-}
- DAKERA_BITEMPORAL_WEIGHT=${DAKERA_BITEMPORAL_WEIGHT:-}
- DAKERA_NAME_BOOST=${DAKERA_NAME_BOOST:-}
- DAKERA_SUPERSEDE_DEMOTE=${DAKERA_SUPERSEDE_DEMOTE:-}
- DAKERA_RERANK_MAX_CANDIDATES=${DAKERA_RERANK_MAX_CANDIDATES:-}
- DAKERA_HOT_TIER=${DAKERA_HOT_TIER:-}
- DAKERA_ROCKSDB_SYNC=${DAKERA_ROCKSDB_SYNC:-}
- DAKERA_ROCKSDB_RECORD_FORMAT=${DAKERA_ROCKSDB_RECORD_FORMAT:-}
- DAKERA_VECTOR_CACHE_BYTES=${DAKERA_VECTOR_CACHE_BYTES:-}
- DAKERA_MAX_MEMORY_CONTENT_BYTES=${DAKERA_MAX_MEMORY_CONTENT_BYTES:-}
- DAKERA_SESSION_IDLE_TIMEOUT_SECS=${DAKERA_SESSION_IDLE_TIMEOUT_SECS:-}
- DAKERA_HNSW_CACHE_TTI_SECS=${DAKERA_HNSW_CACHE_TTI_SECS:-}
- DAKERA_RATE_LIMIT_RPS=${DAKERA_RATE_LIMIT_RPS:-}
- DAKERA_RATE_LIMIT_BURST=${DAKERA_RATE_LIMIT_BURST:-}
# Settings of server v0.12.3 (see .env.example). Written without a
# value: passed ONLY when set in .env (or the shell), so an older image is not
# handed a name it does not know (it would report it as an unknown variable).
- DAKERA_HTTP_HEADER_READ_TIMEOUT_SECS
- DAKERA_NEIGHBORHOOD_MODE
- DAKERA_NEIGHBORHOOD_EVENT_TIME
- DAKERA_RECALL_RANK_DEPTH
- DAKERA_RECALL_COLLAPSE_DERIVED
- DAKERA_RECALL_EXCLUDE_SUMMARIES
- DAKERA_RECALL_SESSION_CAP
- DAKERA_SENTENCE_DECOMP
- DAKERA_SUPERSEDES_EVENT_TIME
- DAKERA_MAX_CONNECTIONS
# Keep below stop_grace_period (30 s) with a margin: the server waits up to 15 s
# for running media jobs, then drains REST connections for at most this long.
- DAKERA_SHUTDOWN_DRAIN_SECS
# Only read with DAKERA_AUTH_ENABLED=false (see .env.example).
- DAKERA_ALLOWED_HOSTS
# Document import (0.12.3, on by default; .env.example "Document import"). PDF / DOCX
# extraction runs in child processes: up to EXTRACT_CONCURRENCY x EXTRACT_MEMORY_MB
# (2 x 1024 MB) on top of the server, inside the 12G limit below.
- DAKERA_DOCUMENTS
- DAKERA_DOCUMENT_MAX_BYTES
- DAKERA_DOCUMENT_MAX_TEXT_BYTES
- DAKERA_DOCUMENT_MAX_CHUNKS
- DAKERA_DOCUMENT_CHUNK_TOKENS
- DAKERA_DOCUMENT_CHUNK_OVERLAP_TOKENS
- DAKERA_DOCUMENT_EXTRACT_TIMEOUT_SECS
- DAKERA_DOCUMENT_EXTRACT_MEMORY_MB
- DAKERA_DOCUMENT_EXTRACT_CONCURRENCY
# Throughput, memory and data-safety settings of server v0.12.3 (.env.example
# "Throughput and safety"). Unset = the server sizes them from the host
# (cores, memory limit); set them only to override.
- DAKERA_MAX_CONCURRENT_INFERENCES
- DAKERA_ADMISSION_WAIT_SECS
- DAKERA_INTERACTIVE_MIN_CORES
- DAKERA_EMBED_PREPACK
- DAKERA_RERANK_PREPACK
- DAKERA_RERANKER_MODEL
- DAKERA_RERANK_CACHE_ENTRIES
- DAKERA_RERANK_PASSAGE_TOKENS
- DAKERA_HNSW_CACHE_BYTES
- DAKERA_MEM_TRIM_INTERVAL_SECS
- DAKERA_LONG_CONTENT_WINDOWS
- DAKERA_AUDIT_SAMPLE_RATE
- DAKERA_AUDIT_READ_SAMPLE_RATE
- DAKERA_AUTOPILOT_DEDUP_MODE
- DAKERA_AUTOPILOT_DEDUP_CROSS_SESSION
- DAKERA_AUTOPILOT_CONSOLIDATE_CROSS_SESSION
- DAKERA_AUTOPILOT_TRASH_RETENTION_HOURS
- REEMBED_BATCH_SIZE
- REEMBED_INTERVAL_SECS
# gRPC listener: an EMPTY value would read as OFF on an upgraded deployment (v0.11's
# reading), so this one defaults to true explicitly.
- DAKERA_GRPC_ENABLED=${DAKERA_GRPC_ENABLED:-true}
- HF_ENDPOINT=${HF_ENDPOINT:-}
- HF_HUB_OFFLINE=${HF_HUB_OFFLINE:-}
- HTTPS_PROXY=${HTTPS_PROXY:-}
- HTTP_PROXY=${HTTP_PROXY:-}
- ALL_PROXY=${ALL_PROXY:-}
- NO_PROXY=${NO_PROXY:-}
# FW-b5ad5a7f / DAK-9814: mimalloc returns freed pages to the OS
# immediately (purge delay 0ms) so container RSS returns to baseline
# after allocation peaks instead of retaining decommitted heap.
- MIMALLOC_PURGE_DELAY=0
volumes:
# The data root, plus the warm and hot tiers on the volumes they had
# before v0.12 (dakera-cache held /data/cache, so the warm tier at
# /data/cache/warm is where it was), mounted where the root derives them.
- dakera-data:/data
- dakera-cache:/data/cache
- dakera-rocksdb:/data/hot
# Model cache (HF_HOME): models the image does not ship (DAKERA_MODEL=bge-m3,
# whisper, ...), downloaded once. The image's own models (bge-large, the
# reranker) are read from the image itself. Pre-pull, e.g. air-gapped:
# docker compose run --rm dakera models pull bge-m3
# and free what an older image left here: ... run --rm dakera models prune
- dakera-models:/app/models
# Hardening: the server writes only to the volumes above and /tmp, runs as the
# image's uid 1000 and needs no Linux capability.
read_only: true
tmpfs:
- /tmp:size=1g,mode=1777
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
# DAK-9890: raised 8G→12G — fleet load showed 7.14GiB under full agent
# fleet. Hot tier + lazy HNSW cache grow past 8G; 12G gives 4G headroom.
# Soft limit (memory.high) set to 10G in dakera-mem.slice (re-run
# scripts/install-dakera-mem-slice.sh to apply).
memory: 12G
cpus: "4.0"
reservations:
memory: 512M
cpus: "0.5"
ulimits:
nofile:
soft: 65536
hard: 1048576
depends_on:
minio-setup:
condition: service_completed_successfully
healthcheck:
# /health/ready is 503 while the models load (the port answers meanwhile,
# /health/live is 200); a model not in the image downloads first.
# Works with every image: the images up to v0.12.2 have curl but no
# `dakera healthcheck` (there an unknown argument would start a SECOND
# server); the newer ones have `dakera healthcheck` (exit 0 only on 200) and
# their runtime image drops curl.
test: ["CMD-SHELL", "if command -v curl >/dev/null 2>&1; then curl -fsS http://127.0.0.1:3000/health/ready >/dev/null; else dakera healthcheck /health/ready; fi"]
interval: 10s
timeout: 5s
# Reduced 5→3: mark unhealthy faster (30s vs 50s) so watchdog triggers
# sooner. The dakera-watchdog sidecar auto-restarts on streak ≥ 5 (50s).
retries: 3
# Failures inside the start period do not count; the first success ends it.
start_period: 600s
# SIGTERM starts the graceful shutdown: running media-job stores are waited for up
# to 15 s, then the REST drain (DAKERA_SHUTDOWN_DRAIN_SECS, 8 s by default, 0.12.3),
# then the final flushes. Compose's default (10 s) would kill it first; 30 s matches
# the Kubernetes manifests. Raise it with DAKERA_SHUTDOWN_DRAIN_SECS.
stop_grace_period: 30s
restart: unless-stopped
networks:
- dakera-net
# ==========================================================================
# MinIO - S3-Compatible Object Storage
# ==========================================================================
minio:
# minio/minio and minio/mc are no longer published on Docker Hub (the repositories
# are gone; a fresh `docker compose pull` fails). Chainguard's MinIO build is
# maintained and ships `mc`. Root, as minio/minio ran: a minio-data volume written
# by the old image stays writable.
image: cgr.dev/chainguard/minio:latest
user: "0:0"
container_name: dakera-minio
command: server /data --console-address ":9001"
ports:
- "127.0.0.1:${MINIO_API_PORT:-9000}:9000"
- "127.0.0.1:${MINIO_CONSOLE_PORT:-9001}:9001"
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-minioadmin}
- MINIO_API_REQUESTS_MAX=${MINIO_API_REQUESTS_MAX:-6000}
# DAK-9890: cap per-request lifetime so stalled S3 connections (seen as
# 'connection closed before message completed') fail fast rather than
# accumulating and exhausting the connection pool.
- MINIO_API_REQUESTS_DEADLINE=${MINIO_API_REQUESTS_DEADLINE:-2m}
# Lets the monitoring profile's Prometheus scrape /minio/v2/metrics/cluster
# (without it the minio target is DOWN: 403). The port is bound to 127.0.0.1.
- MINIO_PROMETHEUS_AUTH_TYPE=public
volumes:
- minio-data:/data
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 4G
cpus: "2.0"
reservations:
memory: 512M
cpus: "0.25"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 10
restart: unless-stopped
networks:
- dakera-net
# ==========================================================================
# Dakera Health Watchdog — auto-restart + Telegram alerting (DAK-9890)
# ==========================================================================
# Monitors the dakera container every DAKERA_WATCHDOG_POLL_SECS seconds.
# - Health failingStreak ≥ DAKERA_WATCHDOG_RESTART_AFTER (default 5) →
# `docker restart dakera` + Telegram alert.
# - Memory ≥ DAKERA_WATCHDOG_MEM_ALERT_PCT (default 90%) of 12G limit →
# Telegram warning (re-alerts every 10 cycles, not every poll).
#
# Fixes the core gap from DAK-9890: Docker's `restart: unless-stopped` only
# triggers on process exit — NOT on healthcheck failure. The watchdog fills
# that gap. Without it an unhealthy container can sit stuck for days.
#
# Set TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID in .env to enable Telegram.
# Alerts are logged to container stdout even without Telegram credentials.
#
# Security: Docker socket mounted read-write (needed for `docker restart`).
# Scope: only ever touches the container named 'dakera'.
dakera-watchdog:
image: docker:27-cli
container_name: dakera-watchdog
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./scripts/dakera-watchdog.sh:/usr/local/bin/dakera-watchdog.sh:ro
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID:-}
- DAKERA_WATCHDOG_RESTART_AFTER=${DAKERA_WATCHDOG_RESTART_AFTER:-5}
- DAKERA_WATCHDOG_MEM_ALERT_PCT=${DAKERA_WATCHDOG_MEM_ALERT_PCT:-90}
- DAKERA_WATCHDOG_POLL_SECS=${DAKERA_WATCHDOG_POLL_SECS:-30}
command: ["sh", "/usr/local/bin/dakera-watchdog.sh"]
# Root (the Docker socket is root's), but with no capability, nothing to
# escalate to and a read-only root filesystem: it only talks to the socket.
read_only: true
tmpfs:
- /tmp:size=16m
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 64M
cpus: "0.25"
depends_on:
- dakera
restart: unless-stopped
networks:
- dakera-net
# ==========================================================================
# MinIO Setup - Create bucket on startup
# ==========================================================================
minio-setup:
# The MinIO image above (it has a shell and `mc`); minio/mc is no longer published.
image: cgr.dev/chainguard/minio:latest
container_name: dakera-minio-setup
depends_on:
minio:
condition: service_healthy
# The credentials MinIO was started with: without these the alias below
# would always use minioadmin and bucket creation fails once
# MINIO_ROOT_USER / MINIO_ROOT_PASSWORD are changed (as .env.example asks).
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-minioadmin}
entrypoint: >
/bin/sh -c "
mc alias set myminio http://minio:9000 $${MINIO_ROOT_USER:-minioadmin} $${MINIO_ROOT_PASSWORD:-minioadmin};
mc mb myminio/dakera --ignore-existing;
echo 'Dakera bucket ready';
exit 0;
"
security_opt:
- no-new-privileges:true
networks:
- dakera-net
# ==========================================================================
# Prometheus + Grafana (optional — monitoring profile)
# ==========================================================================
# Enable with: docker compose --profile monitoring up -d
# Prometheus: http://localhost:9090
# Grafana: http://localhost:3003 (user admin, password GRAFANA_PASSWORD from .env;
# a NEW Grafana refuses to start without one, see the grafana service)
prometheus:
image: prom/prometheus:v3.2.0
container_name: dakera-prometheus
profiles: ["monitoring", "full"]
ports:
- "127.0.0.1:${PROMETHEUS_PORT:-9090}:9090"
volumes:
- ../monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ../monitoring/alerting-rules.yml:/etc/prometheus/alerting-rules.yml:ro
- ../monitoring/dakera.rules.yml:/etc/prometheus/dakera.rules.yml:ro
- prometheus-data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=15d"
- "--web.enable-lifecycle"
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
restart: unless-stopped
networks:
- dakera-net
grafana:
image: grafana/grafana:11.4.0
container_name: dakera-grafana
profiles: ["monitoring", "full"]
ports:
- "127.0.0.1:${GRAFANA_PORT:-3003}:3000"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin}
# No default password (it used to be `admin`). Grafana only reads it when it
# creates its database: the entrypoint below refuses that first start without a
# GRAFANA_PASSWORD (or with `admin`); an existing Grafana keeps its password and
# starts as before. Not `${GRAFANA_PASSWORD:?}`: Compose would then refuse
# every profile, the production `--profile dashboard` included.
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_AUTH_ANONYMOUS_ENABLED=false
- GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/etc/grafana/provisioning/dashboards/json/dakera-overview.json
entrypoint:
- /bin/sh
- -c
- >-
if [ ! -s /var/lib/grafana/grafana.db ] &&
{ [ -z "$${GF_SECURITY_ADMIN_PASSWORD}" ] || [ "$${GF_SECURITY_ADMIN_PASSWORD}" = admin ]; };
then echo 'Set GRAFANA_PASSWORD in .env (not admin) before the first start of Grafana' >&2; exit 1; fi;
[ -n "$${GF_SECURITY_ADMIN_PASSWORD}" ] || unset GF_SECURITY_ADMIN_PASSWORD;
exec /run.sh
volumes:
- grafana-data:/var/lib/grafana
- ../monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
depends_on:
- prometheus
restart: unless-stopped
networks:
- dakera-net
# ==========================================================================
# Dakera Dashboard (optional)
# ==========================================================================
dashboard:
# 0.5.2 (deploys like 0.4.0 / 0.5.x; runs as uid 10001, no curl inside).
# Operators sign in at /login with their OWN Dakera
# API key, held in server memory by the dashboard's session service (no key in
# this container: DAKERA_API_KEY and DAKERA_CLIENT_URL are gone since 0.4.0).
# Sessions are in memory, so a restart signs everyone out. Put TLS in front
# (README, "Dashboard 0.5.0", TLS in front):
# the proxy must forward X-Forwarded-Proto and the original Host.
image: ${DASHBOARD_IMAGE:-ghcr.io/dakera-ai/dakera-dashboard:0.5.2}
container_name: dakera-dashboard
profiles: ["dashboard", "full"]
ports:
- "127.0.0.1:${DASHBOARD_PORT:-3002}:3000"
environment:
# A plain http(s)://host[:port][/path] URL (0.5.2 refuses anything else: it is
# written into nginx configuration).
- DAKERA_API_UPSTREAM=http://dakera:3000
# Longest a sign-in lasts (default 12; idle sessions end after 2 h):
- DAKERA_SESSION_TTL_HOURS=${DAKERA_SESSION_TTL_HOURS:-12}
# Dashboard 0.5.2: addresses / CIDRs (comma or space separated) of the reverse
# proxies in front of it whose X-Forwarded-For names the client (nginx real_ip;
# the sign-in throttle counts that address). Empty: the connecting peer is the
# client. E.g. the Docker bridge gateway when a host proxy forwards to it.
- DAKERA_TRUSTED_PROXIES=${DAKERA_TRUSTED_PROXIES:-}
# python3 (in every dashboard image; 0.5.2 has no curl), proxies ignored, exit != 0
# on anything but a 2xx: nginx up AND the session service answering through it.
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request as u; u.build_opener(u.ProxyHandler({})).open('http://127.0.0.1:3000/_session/healthz', timeout=5)"]
interval: 30s
timeout: 10s
start_period: 10s
retries: 3
# 0.5.2 runs as uid/gid 10001 and needs no capability. The four below are only for
# a DASHBOARD_IMAGE up to 0.5.1, which starts as root (nginx and the session service
# then drop to their own users; measured with 0.5.1). Not read_only for the same
# reason (0.5.1 edits its nginx configuration at start; 0.5.2 writes only /tmp).
cap_drop: [ALL]
cap_add: [CHOWN, DAC_OVERRIDE, SETGID, SETUID]
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 256M
cpus: "0.5"
depends_on:
dakera:
condition: service_healthy
restart: unless-stopped
networks:
- dakera-net
# ==========================================================================
# Dakera ODE — On-Demand Enhancement sidecar (optional)
# ==========================================================================
# Enable with: docker compose --profile ode up -d
# ODE endpoint: http://localhost:8080/ode/enhance
# Webhook: http://localhost:8080/internal/webhook/memory-stored
#
# Configure dakera to fire webhook events:
# DAKERA_ODE_WEBHOOK_URL=http://dakera-ode:8080/internal/webhook/memory-stored
# ==========================================================================
dakera-ode:
image: ${ODE_IMAGE:-ghcr.io/dakera-ai/dakera-ode:0.2.0}
container_name: dakera-ode
profiles: ["ode", "full"]
ports:
- "127.0.0.1:${ODE_PORT:-8080}:8080"
environment:
- LOG_LEVEL=${ODE_LOG_LEVEL:-info}
deploy:
resources:
limits:
memory: 1G
cpus: "1.0"
reservations:
memory: 256M
cpus: "0.25"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
security_opt:
- no-new-privileges:true
restart: unless-stopped
networks:
- dakera-net
volumes:
dakera-data:
dakera-cache:
dakera-rocksdb:
dakera-models:
minio-data:
prometheus-data:
grafana-data:
networks:
dakera-net:
driver: bridge