-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
73 lines (71 loc) · 3.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
73 lines (71 loc) · 3.19 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
services:
# One-shot init container: docker creates named volumes root:root mode
# 755, but the iii-engine image is distroless and runs as UID 65532
# with no `chown` of its own. Without this, /data is unwritable, the
# engine silently buffers in RAM, and state evaporates on every
# restart — the exact symptom v0.9.7's working-directory fix set out
# to solve. Runs once at compose-up and exits.
iii-init:
image: busybox:1.36
user: "0:0"
environment:
AGENTMEMORY_DOCKER_UID: "${AGENTMEMORY_DOCKER_UID:-65532}"
AGENTMEMORY_DOCKER_GID: "${AGENTMEMORY_DOCKER_GID:-65532}"
AGENTMEMORY_DOCKER_SKIP_CHOWN: "${AGENTMEMORY_DOCKER_SKIP_CHOWN:-0}"
volumes:
- "${AGENTMEMORY_DATA_DIR:-iii-data}:/data"
entrypoint: ["sh", "-c", "if [ \"$${AGENTMEMORY_DOCKER_SKIP_CHOWN}\" = \"1\" ]; then exit 0; fi; chown -R $${AGENTMEMORY_DOCKER_UID}:$${AGENTMEMORY_DOCKER_GID} /data && chmod 755 /data"]
restart: "no"
iii-engine:
# Pinned to the same release as agentmemory's iii-sdk dependency
# (package.json). The worker speaks this engine's wire protocol, so
# bump the image tag and the SDK together, never one of them alone.
# 0.22.x is the last line before 0.23 removes the config.yaml worker
# lifecycle; it keeps HTTP routes owned by the reconnecting worker.
#
# Override per-shell or via .env file:
# AGENTMEMORY_III_VERSION=0.22.1 docker compose up
image: iiidev/iii:${AGENTMEMORY_III_VERSION:-0.22.1}
user: "${AGENTMEMORY_DOCKER_UID:-65532}:${AGENTMEMORY_DOCKER_GID:-65532}"
depends_on:
iii-init:
condition: service_completed_successfully
command: ["--config", "/app/config.yaml", "--no-update-check"]
environment:
III_TELEMETRY_ENABLED: "${III_TELEMETRY_ENABLED:-false}"
III_REST_PORT: "${III_REST_PORT:-3111}"
III_STREAM_PORT: "${III_STREAM_PORT:-3112}"
III_VIEWER_PORT: "${III_VIEWER_PORT:-3113}"
III_ENGINE_PORT: "${III_ENGINE_PORT:-49134}"
AGENTMEMORY_REDIS_URL: "${AGENTMEMORY_REDIS_URL:-}"
AGENTMEMORY_STATE_SAVE_INTERVAL_MS: "${AGENTMEMORY_STATE_SAVE_INTERVAL_MS:-2000}"
MALLOC_ARENA_MAX: "${MALLOC_ARENA_MAX:-2}"
ulimits:
nofile:
soft: 10240
hard: 10240
ports:
- "127.0.0.1:${III_ENGINE_PORT:-49134}:${III_ENGINE_PORT:-49134}"
- "127.0.0.1:${III_REST_PORT:-3111}:${III_REST_PORT:-3111}"
- "127.0.0.1:${III_STREAM_PORT:-3112}:${III_STREAM_PORT:-3112}"
- "127.0.0.1:${AGENTMEMORY_METRICS_PORT:-9464}:9464"
volumes:
- "${AGENTMEMORY_DATA_DIR:-iii-data}:/data"
- ./iii-config.docker.yaml:/app/config.yaml:ro
# The engine persists each builtin worker's seeded config block under
# config/ next to its config file (/app/config in the image) on first
# boot and treats that copy as the source of truth afterwards. Keeping
# it on a tmpfs means every container start re-seeds from config.yaml
# and the III_* env vars, the same behavior the native CLI path has.
- type: tmpfs
target: /app/config
tmpfs:
mode: 01777
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
iii-data: