Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
331 lines (320 loc) · 14.6 KB
/
Copy pathdocker-compose.yml
File metadata and controls
331 lines (320 loc) · 14.6 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
version: '3.8'
services:
db:
image: postgres:16-alpine
container_name: riffado-db
restart: unless-stopped
environment:
POSTGRES_USER: postgres
# Keep the postgres default for existing volumes. Postgres uses this
# value to set the role password only when initializing the database.
# Rotate in place with \password postgres and a hex password (openssl rand -hex 24).
# See /docs/self-hosting/environment-variables#bundled-postgres for the steps.
# Keep the db volume to preserve its data.
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: riffado
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
app:
# Pull the published image by default.
# - `latest` → newest stable release (recommended)
# - `2026.1` → pin to a specific release
# - `dev` → rolling build from the `dev` branch (unstable, opt-in)
# Override via CHATTERBOX_VERSION in .env. RIFFADO_VERSION is accepted for one release.
image: ghcr.io/fgforrest/chatterbox:${CHATTERBOX_VERSION:-${RIFFADO_VERSION:-latest}}
container_name: riffado-app
restart: unless-stopped
ports:
- "3000:3000"
environment:
# Database
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-postgres}@db:5432/riffado
# Auth
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET}
APP_URL: ${APP_URL:-http://localhost:3000}
DISABLE_REGISTRATION: ${DISABLE_REGISTRATION:-}
RATE_LIMIT_TRUST_PROXY_HEADERS: ${RATE_LIMIT_TRUST_PROXY_HEADERS:-false}
RATE_LIMIT_CLIENT_IP_HEADER: ${RATE_LIMIT_CLIENT_IP_HEADER:-}
SELF_HOST_MODE: ${SELF_HOST_MODE:-shared}
# Organization scope (optional; both email and password enable it,
# the email alone under single sign-on)
ORG_ACCOUNT_EMAIL: ${ORG_ACCOUNT_EMAIL:-}
ORG_ACCOUNT_PASSWORD: ${ORG_ACCOUNT_PASSWORD:-}
ORG_ACCOUNT_NAME: ${ORG_ACCOUNT_NAME:-}
ORG_PROVIDER_CALLS_PER_MEMBER_PER_HOUR: ${ORG_PROVIDER_CALLS_PER_MEMBER_PER_HOUR:-}
# Single sign-on (optional; see docs/self-hosting/sso). With issuer,
# client id and secret set, it is the only way to sign in.
OIDC_ISSUER_URL: ${OIDC_ISSUER_URL:-}
OIDC_CLIENT_ID: ${OIDC_CLIENT_ID:-}
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET:-}
OIDC_PROVIDER_NAME: ${OIDC_PROVIDER_NAME:-}
OIDC_SCOPES: ${OIDC_SCOPES:-}
OIDC_SESSION_MAX_AGE: ${OIDC_SESSION_MAX_AGE:-}
# External MCP server (optional; see docs/self-hosting/mcp). Off
# unless MCP_AUDIENCE is set; requires single sign-on above and uses
# the same realm.
MCP_AUDIENCE: ${MCP_AUDIENCE:-}
MCP_ALLOWED_CLIENTS: ${MCP_ALLOWED_CLIENTS:-}
MCP_PUBLIC_INGRESS_HEADER: ${MCP_PUBLIC_INGRESS_HEADER:-}
MCP_PUBLIC_CLIENTS: ${MCP_PUBLIC_CLIENTS:-}
MCP_CONNECTOR_KEYS: ${MCP_CONNECTOR_KEYS:-}
MCP_RESOURCE_AUDIENCE: ${MCP_RESOURCE_AUDIENCE:-}
MCP_AUDIT_RETENTION_DAYS: ${MCP_AUDIT_RETENTION_DAYS:-}
MCP_SERVICE_CLIENTS: ${MCP_SERVICE_CLIENTS:-}
# Authorization from the identity provider (optional; see
# docs/self-hosting/sso). Off unless AUTHZ_MODE=idp; requires single
# sign-on above.
AUTHZ_MODE: ${AUTHZ_MODE:-}
IDENTITY_PROVIDER: ${IDENTITY_PROVIDER:-}
KEYCLOAK_ROLES_CLIENT: ${KEYCLOAK_ROLES_CLIENT:-}
KEYCLOAK_GROUP_USE_ID: ${KEYCLOAK_GROUP_USE_ID:-}
KEYCLOAK_GROUP_CURATE_ID: ${KEYCLOAK_GROUP_CURATE_ID:-}
KEYCLOAK_GROUP_ACCESS_MANAGE_ID: ${KEYCLOAK_GROUP_ACCESS_MANAGE_ID:-}
KEYCLOAK_VERIFIER_CLIENT_ID: ${KEYCLOAK_VERIFIER_CLIENT_ID:-}
KEYCLOAK_VERIFIER_CLIENT_SECRET: ${KEYCLOAK_VERIFIER_CLIENT_SECRET:-}
AUTHZ_VERIFICATION_MAX_AGE: ${AUTHZ_VERIFICATION_MAX_AGE:-}
AUTHZ_ADMIN_MAX_AUTH_AGE: ${AUTHZ_ADMIN_MAX_AUTH_AGE:-}
# Inbound mail (optional; see mail-receiver/README.md). Off unless
# MAIL_DOMAIN is set; requires single sign-on above, both secrets,
# and the mail-receiver service (profile `mail`).
MAIL_DOMAIN: ${MAIL_DOMAIN:-}
MAIL_ORG_NICKNAME: ${MAIL_ORG_NICKNAME:-}
MAIL_FORMER_ORG_NICKNAMES: ${MAIL_FORMER_ORG_NICKNAMES:-}
MAIL_ADDRESS_HASH_SECRET: ${MAIL_ADDRESS_HASH_SECRET:-}
MAIL_INGEST_SECRET: ${MAIL_INGEST_SECRET:-}
MAIL_MAX_SIGNATURE_AGE_HOURS: ${MAIL_MAX_SIGNATURE_AGE_HOURS:-}
MAIL_DAILY_LIMIT: ${MAIL_DAILY_LIMIT:-}
MAIL_MAX_MESSAGE_MB: ${MAIL_MAX_MESSAGE_MB:-}
MAIL_INACTIVE_DAYS: ${MAIL_INACTIVE_DAYS:-}
# Meeting Recorder defaults pushed to connected extensions (optional)
RECORDER_AUTO_RECORD_PLATFORMS: ${RECORDER_AUTO_RECORD_PLATFORMS:-}
RECORDER_AUTO_STOP_QUIET_SECONDS: ${RECORDER_AUTO_STOP_QUIET_SECONDS:-180}
RECORDER_NOTICE_TEXT: ${RECORDER_NOTICE_TEXT:-}
RECORDER_LOCK_DEFAULTS: ${RECORDER_LOCK_DEFAULTS:-}
# Operations (optional; see docs/self-hosting/environment-variables)
DISABLE_UPDATE_CHECK: ${DISABLE_UPDATE_CHECK:-}
WEBHOOKS_REQUIRE_PUBLIC_TARGETS: ${WEBHOOKS_REQUIRE_PUBLIC_TARGETS:-}
BACKGROUND_SYNC_ENABLED: ${BACKGROUND_SYNC_ENABLED:-}
BACKGROUND_SYNC_INTERVAL_MS: ${BACKGROUND_SYNC_INTERVAL_MS:-300000}
PLAUD_SYNC_RATE_LIMIT_PER_MINUTE: ${PLAUD_SYNC_RATE_LIMIT_PER_MINUTE:-10}
WEBSHARE_API_KEY: ${WEBSHARE_API_KEY:-}
PLAUD_PROXY_SCOPE: ${PLAUD_PROXY_SCOPE:-all}
VIDEO_UPLOAD_MAX_BYTES: ${VIDEO_UPLOAD_MAX_BYTES:-4294967296}
WHISPER_MAX_BYTES: ${WHISPER_MAX_BYTES:-25165824}
WHISPER_COMPRESS_BITRATE_KBPS: ${WHISPER_COMPRESS_BITRATE_KBPS:-12}
WHISPER_REQUEST_TIMEOUT_MS: ${WHISPER_REQUEST_TIMEOUT_MS:-3600000}
AUTO_SUMMARY_RATE_LIMIT_PER_HOUR: ${AUTO_SUMMARY_RATE_LIMIT_PER_HOUR:-60}
# API_TOKEN_HASH_SECRET is deliberately not passed: setting it on an
# existing install invalidates every stored token and lookup hash.
# Encryption
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
# Storage (optional defaults)
DEFAULT_STORAGE_TYPE: ${DEFAULT_STORAGE_TYPE:-local}
LOCAL_STORAGE_PATH: ${LOCAL_STORAGE_PATH:-/app/audio}
S3_ENDPOINT: ${S3_ENDPOINT:-}
S3_BUCKET: ${S3_BUCKET:-}
S3_REGION: ${S3_REGION:-}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-}
# Folder export destinations are always resolved beneath this fixed
# container boundary. Operators choose only the host-side bind path.
FILESYSTEM_EXPORT_ROOT: /exports
# Backup archives. Unset, they are written beside the recordings; set,
# the host path is mounted at this fixed container path, which no
# host path can make collide with the other mounts.
BACKUP_STORAGE_PATH: ${BACKUP_STORAGE_PATH:+/backups}
# Google Drive export (optional; see docs/self-hosting/google-drive)
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
GOOGLE_PICKER_API_KEY: ${GOOGLE_PICKER_API_KEY:-}
GOOGLE_CLOUD_PROJECT_NUMBER: ${GOOGLE_CLOUD_PROJECT_NUMBER:-}
GOOGLE_WORKSPACE_DOMAINS: ${GOOGLE_WORKSPACE_DOMAINS:-}
# Learn (optional; see docs/self-hosting/environment-variables)
EMBEDDING_BASE_URL: ${EMBEDDING_BASE_URL:-}
EMBEDDING_TIMEOUT_MS: ${EMBEDDING_TIMEOUT_MS:-}
EMBEDDING_MODEL: ${EMBEDDING_MODEL:-}
EMBEDDING_API_KEY: ${EMBEDDING_API_KEY:-}
LEARN_MCP_URL: ${LEARN_MCP_URL:-}
LEARN_BRIDGE_URL: ${LEARN_BRIDGE_URL:-}
KNOWLEDGE_MEMORY_MB: ${KNOWLEDGE_MEMORY_MB:-}
# SMTP (optional: password reset + email notifications)
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-}
SMTP_SECURE: ${SMTP_SECURE:-}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
SMTP_FROM: ${SMTP_FROM:-}
SMTP_MARKETING_FROM: ${SMTP_MARKETING_FROM:-}
SMTP_REPLY_TO: ${SMTP_REPLY_TO:-}
volumes:
# Official compose defaults LOCAL_STORAGE_PATH to /app/audio.
# The app default without that override is ./storage → /app/storage
# in this image (WORKDIR /app). Persist both so neither path is
# wiped on container recreate.
- audio:/app/audio
- storage:/app/storage
- ${FILESYSTEM_EXPORT_HOST_PATH:-./exports}:/exports
# The `backups` volume only stands in while BACKUP_STORAGE_PATH is unset.
- ${BACKUP_STORAGE_PATH:-backups}:/backups
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 3s
start_period: 30s
retries: 3
# Optional. Serves an OpenAI-compatible `chat/completions` endpoint
# backed by the Claude Code and Codex CLIs, so a *subscription* can
# generate summaries instead of a metered API key. See
# `agent-bridge/README.md`; opt in with `--profile agent-bridge`.
#
# Add it in Chatterbox under Settings -> AI Providers as the "Claude Code"
# or "Codex" preset; both prefill http://agent-bridge:8787/v1 and take
# BRIDGE_TOKEN as the API key.
agent-bridge:
profiles: ["agent-bridge"]
build:
context: ./agent-bridge
args:
# Pin these. See the note in agent-bridge/Dockerfile.
CLAUDE_CODE_VERSION: ${CLAUDE_CODE_VERSION:-latest}
CODEX_VERSION: ${CODEX_VERSION:-latest}
container_name: riffado-agent-bridge
restart: unless-stopped
# Reaps what a killed CLI leaves behind (npm's codex is a wrapper whose
# real binary outlives it by a moment); node as PID 1 would not.
init: true
# Deliberately no `ports:`. The bridge spends your subscription, so
# it is reachable only from other services on this compose network --
# publishing it would expose that to the host and anything routed to
# it. Chatterbox reaches it by service name.
environment:
BRIDGE_TOKEN: ${BRIDGE_TOKEN}
# From `claude setup-token`. Leave unset if you instead ran
# `docker compose run --rm agent-bridge claude auth login`, which
# writes a credential into the agent_creds volume below.
CLAUDE_CODE_OAUTH_TOKEN: ${CLAUDE_CODE_OAUTH_TOKEN:-}
BRIDGE_MAX_CONCURRENCY: ${BRIDGE_MAX_CONCURRENCY:-1}
# Learn with tools can take several minutes on a long recording.
BRIDGE_TIMEOUT_MS: ${BRIDGE_TIMEOUT_MS:-900000}
# Learn's read-only knowledge tools on the app (see agent-bridge/README.md).
BRIDGE_LEARN_MCP_URL: ${LEARN_MCP_URL:-}
CLAUDE_EXTRA_ARGS: ${CLAUDE_EXTRA_ARGS:-}
CODEX_EXTRA_ARGS: ${CODEX_EXTRA_ARGS:-}
volumes:
# Both CLIs refresh their own OAuth tokens in place, so this has to
# be writable and survive recreates. It holds ~/.claude and
# ~/.codex -- treat it as sensitive as the app's ENCRYPTION_KEY.
- agent_creds:/home/node
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8787/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
# Optional. Inbound mail: an SMTP server for MAIL_DOMAIN that accepts mail
# from Google's sending servers only, never relays and never sends, and
# hands each message to the app (see mail-receiver/README.md). Opt in with
# `--profile mail`. It holds no database credentials and no encryption
# key. Port 25 is the deployment's to publish (an override mapping
# "25:2525"); the base file binds the container to loopback only.
# Built from this checkout unless an override sets the published image,
# ghcr.io/fgforrest/chatterbox-mail-receiver (same tags as the app).
mail-receiver:
profiles: ["mail"]
image: chatterbox-mail-receiver:local
build:
context: .
dockerfile: mail-receiver/Dockerfile
container_name: riffado-mail-receiver
restart: unless-stopped
init: true
read_only: true
tmpfs:
# Messages are spooled here while they are checked, never on disk.
- /spool:size=256m,mode=1777
environment:
MAIL_DOMAIN: ${MAIL_DOMAIN:-}
MAIL_HOSTNAME: ${MAIL_HOSTNAME:-}
MAIL_INGEST_URL: http://app:3000
MAIL_INGEST_SECRET: ${MAIL_INGEST_SECRET:-}
MAIL_MAX_MESSAGE_MB: ${MAIL_MAX_MESSAGE_MB:-36}
# `google` (Google's published sending ranges), CIDRs, or both.
MAIL_ALLOWED_SOURCES: ${MAIL_ALLOWED_SOURCES:-google}
# Behind a TCP proxy: the proxies' IP addresses whose PROXY protocol
# v1 header names the client (see mail-receiver/README.md).
MAIL_PROXY_PROTOCOL_FROM: ${MAIL_PROXY_PROTOCOL_FROM:-}
MAIL_TLS_CERT_FILE: /tls/fullchain.pem
MAIL_TLS_KEY_FILE: /tls/privkey.pem
volumes:
- ${MAIL_TLS_DIR:-./mail-tls}:/tls:ro
ports:
- "127.0.0.1:2525:2525"
depends_on:
app:
condition: service_healthy
# Optional. Embeddings for Learn: BAAI/bge-m3 served by Ollama on CPU,
# about 1.3 GB of memory with the model loaded (Spike 0.2). Opt in with
# `--profile learn`, then set in .env:
# EMBEDDING_BASE_URL=http://embeddings:11434/v1
# EMBEDDING_MODEL=bge-m3
# The first start downloads the model (1.2 GB) into the volume below.
embeddings:
profiles: ["learn"]
image: ollama/ollama:0.34.4@sha256:8262851b2846b87c649eddf3e76beb270c52f4d1bc94559f47efde16b0841551
container_name: riffado-embeddings
restart: unless-stopped
# Deliberately no `ports:`: only the app, by service name, needs it.
environment:
OLLAMA_HOST: 0.0.0.0:11434
EMBEDDING_MODEL: ${EMBEDDING_MODEL:-bge-m3}
# Keep the model loaded between runs instead of loading it (about a
# second) after five idle minutes.
OLLAMA_KEEP_ALIVE: ${EMBEDDING_KEEP_ALIVE:-24h}
# Serve, and pull the model once the server answers; a failed pull
# (offline) leaves the service unhealthy and Learn matching words only.
# An init process forwards `docker stop` to Ollama; if the server dies
# before it answers, the container exits and is restarted.
init: true
entrypoint:
- /bin/sh
- -c
- >-
ollama serve & server=$$!;
until ollama list >/dev/null 2>&1; do kill -0 $$server 2>/dev/null || exit 1; sleep 1; done;
ollama pull "$$EMBEDDING_MODEL" || echo "could not pull the embedding model";
wait $$server
volumes:
- embeddings:/root/.ollama
deploy:
resources:
limits:
memory: 3G
healthcheck:
test: ["CMD-SHELL", "ollama show \"$$EMBEDDING_MODEL\" >/dev/null"]
interval: 30s
timeout: 10s
start_period: 5m
retries: 3
volumes:
pgdata:
driver: local
audio:
driver: local
agent_creds:
driver: local
storage:
driver: local
backups:
driver: local
embeddings:
driver: local