-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathdocker-compose.self-host.yml
More file actions
325 lines (313 loc) · 12.7 KB
/
Copy pathdocker-compose.self-host.yml
File metadata and controls
325 lines (313 loc) · 12.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
name: roomote
# One shared application image ships web, api, controller, bullmq,
# preview-proxy, and the db-migrate one-shot. db-migrate owns the build (it
# runs first); every other service runs the same image with a different
# entrypoint-dispatcher command (see .docker/app/entrypoint.sh).
x-roomote-app-image: &roomote-app-image roomote-app:self-host
x-roomote-env: &roomote-env
NODE_ENV: development
R_APP_ENV: development
ROOMOTE_DOCKER_LOAD_ENV_FILE: 'false'
HOST: 0.0.0.0
DATABASE_URL: postgres://postgres:password@postgres:5432/roomote_development
REDIS_URL: redis://redis:6379
S3_ENDPOINT: ${S3_ENDPOINT:-http://minio:9000}
S3_PRESIGN_ENDPOINT: ${S3_PRESIGN_ENDPOINT:-http://minio:9000}
S3_REGION: ${S3_REGION:-us-east-1}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-roomote}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-roomote-local-artifacts-password}
S3_BUCKET_ARTIFACTS: ${S3_BUCKET_ARTIFACTS:-roomote-artifacts}
R_APP_URL: ${R_PUBLIC_URL:-http://localhost:13000}
R_INSTANCE_ID: ${R_INSTANCE_ID:-}
R_CURATED_INTEGRATIONS_DISABLED: ${R_CURATED_INTEGRATIONS_DISABLED:-false}
R_COMMUNICATIONS_FAST_MODE_SETTING_ENABLED: ${R_COMMUNICATIONS_FAST_MODE_SETTING_ENABLED:-false}
# The Brain: supplying this key gives the deployment shared memory that
# agents consult. It powers the brain service's embeddings and is the
# single activation signal — there is no Settings UI for it.
R_BRAIN_OPENROUTER_API_KEY: ${R_BRAIN_OPENROUTER_API_KEY:-}
R_BRAIN_OPENAI_API_KEY: ${R_BRAIN_OPENAI_API_KEY:-}
# Shared secret the Brain presents to /api/brain/inference. REQUIRED to
# enable the Brain: a provider key alone leaves it unable to embed. The
# installer generates one; set any 32+ random characters by hand.
R_BRAIN_GATEWAY_TOKEN: ${R_BRAIN_GATEWAY_TOKEN:-}
# Which models the Brain runs, in the configured provider's own naming.
# The synthesis model is free to change; the embedding pair is create-time.
R_BRAIN_MODEL: ${R_BRAIN_MODEL:-}
R_BRAIN_EMBEDDING_MODEL: ${R_BRAIN_EMBEDDING_MODEL:-}
R_BRAIN_EMBEDDING_DIMENSIONS: ${R_BRAIN_EMBEDDING_DIMENSIONS:-}
R_BRAIN_RERANKER_MODEL: ${R_BRAIN_RERANKER_MODEL:-}
R_GBRAIN_URL: ${R_GBRAIN_URL:-http://gbrain:8931}
# Roomote reads the brain's bootstrap token once to register its own
# scoped clients; api and bullmq mount the brain volume read-only.
R_GBRAIN_ADMIN_TOKEN_FILE: /gbrain-data/admin-bootstrap-token
# Written by the Brain on first boot when no token was supplied, so a stack
# started by hand needs only a provider key.
R_BRAIN_GATEWAY_TOKEN_FILE: /gbrain-data/gateway-token
TRPC_URL: http://api:3001
PREVIEW_PROXY_BASE_URL: ${PREVIEW_PROXY_BASE_URL:-http://localhost:18081}
PREVIEW_DOMAINS: ${PREVIEW_DOMAINS:-localhost,127.0.0.1,roomotepreview.localhost}
R_PUBLIC_URL: ${R_PUBLIC_URL:-}
R_ALLOWED_EMAILS: ${R_ALLOWED_EMAILS:-}
R_LICENSE_KEY: ${R_LICENSE_KEY:-}
R_MODEL: ${R_MODEL:-}
R_SMALL_MODEL: ${R_SMALL_MODEL:-}
R_CODE_REVIEW_MODEL: ${R_CODE_REVIEW_MODEL:-}
R_EXPLORE_MODEL: ${R_EXPLORE_MODEL:-}
R_MODEL_ENV_KEYS: ${R_MODEL_ENV_KEYS:-}
CUSTOM_PROVIDER_API_KEY: ${CUSTOM_PROVIDER_API_KEY:-}
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY:-}
AI_GATEWAY_API_KEY: ${AI_GATEWAY_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
GOOGLE_GENERATIVE_AI_API_KEY: ${GOOGLE_GENERATIVE_AI_API_KEY:-}
AWS_BEARER_TOKEN_BEDROCK: ${AWS_BEARER_TOKEN_BEDROCK:-}
AWS_REGION: ${AWS_REGION:-}
MOONSHOT_API_KEY: ${MOONSHOT_API_KEY:-}
KIMI_API_KEY: ${KIMI_API_KEY:-}
MINIMAX_API_KEY: ${MINIMAX_API_KEY:-}
ZAI_API_KEY: ${ZAI_API_KEY:-}
ZAI_REGION: ${ZAI_REGION:-}
ZAI_CODING_PLAN_API_KEY: ${ZAI_CODING_PLAN_API_KEY:-}
ZAI_CODING_PLAN_REGION: ${ZAI_CODING_PLAN_REGION:-}
OPENCODE_API_KEY: ${OPENCODE_API_KEY:-}
OPENCODE_GO_API_KEY: ${OPENCODE_GO_API_KEY:-}
BASETEN_API_KEY: ${BASETEN_API_KEY:-}
TOGETHER_API_KEY: ${TOGETHER_API_KEY:-}
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
R_GITHUB_APP_ID: ${R_GITHUB_APP_ID:-}
R_GITHUB_APP_PRIVATE_KEY: ${R_GITHUB_APP_PRIVATE_KEY:-}
R_GITHUB_CLIENT_ID: ${R_GITHUB_CLIENT_ID:-}
R_GITHUB_CLIENT_SECRET: ${R_GITHUB_CLIENT_SECRET:-}
R_GITHUB_WEBHOOK_SECRET: ${R_GITHUB_WEBHOOK_SECRET:-}
SLACK_APP_ID: ${SLACK_APP_ID:-}
R_SLACK_CLIENT_ID: ${R_SLACK_CLIENT_ID:-}
R_SLACK_CLIENT_SECRET: ${R_SLACK_CLIENT_SECRET:-}
R_SLACK_SIGNING_SECRET: ${R_SLACK_SIGNING_SECRET:-}
R_TELEGRAM_BOT_TOKEN: ${R_TELEGRAM_BOT_TOKEN:-}
R_TELEGRAM_WEBHOOK_SECRET: ${R_TELEGRAM_WEBHOOK_SECRET:-}
R_DISCORD_BOT_TOKEN: ${R_DISCORD_BOT_TOKEN:-}
R_DISCORD_GATEWAY_SECRET: ${R_DISCORD_GATEWAY_SECRET:-}
R_LINEAR_CLIENT_ID: ${R_LINEAR_CLIENT_ID:-}
R_LINEAR_CLIENT_SECRET: ${R_LINEAR_CLIENT_SECRET:-}
R_LINEAR_WEBHOOK_SECRET: ${R_LINEAR_WEBHOOK_SECRET:-}
R_GITHUB_APP_SLUG: ${R_GITHUB_APP_SLUG:-}
SETUP_TOKEN: ${SETUP_TOKEN:-}
DEFAULT_COMPUTE_PROVIDER: ${DEFAULT_COMPUTE_PROVIDER:-docker}
BL_API_KEY: ${BL_API_KEY:-}
BL_WORKSPACE: ${BL_WORKSPACE:-}
BLAXEL_IMAGE: ${BLAXEL_IMAGE:-}
BLAXEL_REGION: ${BLAXEL_REGION:-}
BLAXEL_STANDBY_MAX_COUNT: ${BLAXEL_STANDBY_MAX_COUNT:-25}
BLAXEL_STANDBY_MAX_AGE_HOURS: ${BLAXEL_STANDBY_MAX_AGE_HOURS:-168}
BOX_API_KEY: ${BOX_API_KEY:-}
BOX_API_BASE_URL: ${BOX_API_BASE_URL:-}
BOX_MACHINE_TYPE: ${BOX_MACHINE_TYPE:-}
BOX_TIMEOUT_MS: ${BOX_TIMEOUT_MS:-}
BOX_STANDBY_MAX_COUNT: ${BOX_STANDBY_MAX_COUNT:-25}
BOX_STANDBY_MAX_AGE_HOURS: ${BOX_STANDBY_MAX_AGE_HOURS:-168}
AZURE_SUBSCRIPTION_ID: ${AZURE_SUBSCRIPTION_ID:-}
AZURE_RESOURCE_GROUP: ${AZURE_RESOURCE_GROUP:-}
AZURE_SANDBOX_GROUP: ${AZURE_SANDBOX_GROUP:-}
AZURE_SANDBOX_REGION: ${AZURE_SANDBOX_REGION:-}
AZURE_SANDBOX_DISK_IMAGE: ${AZURE_SANDBOX_DISK_IMAGE:-}
AZURE_CLIENT_ID: ${AZURE_CLIENT_ID:-}
AZURE_TENANT_ID: ${AZURE_TENANT_ID:-}
AZURE_CLIENT_SECRET: ${AZURE_CLIENT_SECRET:-}
AZURE_SANDBOX_REGISTRY_USERNAME: ${AZURE_SANDBOX_REGISTRY_USERNAME:-}
AZURE_SANDBOX_REGISTRY_TOKEN: ${AZURE_SANDBOX_REGISTRY_TOKEN:-}
AZURE_SANDBOX_SIZE: ${AZURE_SANDBOX_SIZE:-}
AZURE_SANDBOX_EGRESS_INSPECTION: ${AZURE_SANDBOX_EGRESS_INSPECTION:-}
AZURE_HTTP_DEBUG: ${AZURE_HTTP_DEBUG:-}
DOCKER_STANDBY_MAX_COUNT: ${DOCKER_STANDBY_MAX_COUNT:-10}
DOCKER_STANDBY_MAX_AGE_HOURS: ${DOCKER_STANDBY_MAX_AGE_HOURS:-24}
# Declarative environment provisioning: point ROOMOTE_ENVIRONMENTS_DIR at a
# directory of environment YAML files mounted into the api container (for
# example `- ./environments:/roomote/environments:ro` on the api service),
# or put inline multi-document YAML in ROOMOTE_ENVIRONMENTS_YAML. Only the
# api service reads these; see SELF_HOSTING.md.
ROOMOTE_ENVIRONMENTS_DIR: ${ROOMOTE_ENVIRONMENTS_DIR:-}
ROOMOTE_ENVIRONMENTS_YAML: ${ROOMOTE_ENVIRONMENTS_YAML:-}
x-roomote-service: &roomote-service
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
minio-init:
condition: service_completed_successfully
db-migrate:
condition: service_completed_successfully
environment:
<<: *roomote-env
services:
db-migrate:
restart: 'no'
container_name: roomote-db-migrate
image: *roomote-app-image
build:
context: .
dockerfile: .docker/app/Dockerfile
args:
APP_ENV: development
RELEASE_VERSION: ${RELEASE_VERSION:-self-host-local}
environment:
<<: *roomote-env
depends_on:
postgres:
condition: service_healthy
command: ['db-migrate']
web:
<<: *roomote-service
container_name: roomote-web
image: *roomote-app-image
command: ['web']
# Publish app ports to loopback only. Standalone self-host is meant to sit
# behind a reverse proxy on the same host (or the production Caddy overlay,
# which resets these to none); binding to all interfaces would expose the
# web app, API, queue dashboard, and preview proxy directly.
ports:
- '127.0.0.1:13000:3000'
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
minio-init:
condition: service_completed_successfully
db-migrate:
condition: service_completed_successfully
api:
condition: service_started
environment:
<<: *roomote-env
NODE_ENV: production
api:
<<: *roomote-service
container_name: roomote-api
image: *roomote-app-image
command: ['api']
# Reachable from task worker containers (worker -> API over TRPC_URL).
networks: [default, worker]
environment:
<<: *roomote-env
PORT: 3001
volumes:
- gbrain_data:/gbrain-data:ro
ports:
- '127.0.0.1:13001:3001'
controller:
<<: *roomote-service
container_name: roomote-controller
image: *roomote-app-image
command: ['controller']
# Spawns and reaches task worker containers on the worker network.
networks: [default, worker]
stop_grace_period: 7m
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
minio-init:
condition: service_completed_successfully
db-migrate:
condition: service_completed_successfully
api:
condition: service_started
healthcheck:
test:
[
'CMD-SHELL',
'curl -fsS --max-time 5 http://api:3001/health/controller >/dev/null',
]
interval: 5s
timeout: 6s
retries: 12
start_period: 20s
bullmq:
<<: *roomote-service
container_name: roomote-bullmq
image: *roomote-app-image
command: ['bullmq']
environment:
<<: *roomote-env
PORT: 3002
volumes:
- gbrain_data:/gbrain-data:ro
ports:
- '127.0.0.1:13002:3002'
healthcheck:
test:
[
'CMD-SHELL',
'curl -fsS --max-time 5 http://127.0.0.1:3002/admin/health >/dev/null',
]
interval: 5s
timeout: 6s
retries: 12
start_period: 20s
preview-proxy:
<<: *roomote-service
container_name: roomote-preview-proxy
image: *roomote-app-image
command: ['preview-proxy']
# Proxies preview traffic into task worker containers.
networks: [default, worker]
environment:
<<: *roomote-env
PORT: 8081
ports:
- '127.0.0.1:18081:8081'
# Brain (deployment-hosted gbrain). Opt-in via
# COMPOSE_PROFILES=brain; deployments that never enable the
# profile see no infrastructure change. Internal-only: no published
# ports, reachable solely by the API service, which fronts it at
# /api/mcp/gbrain with the read-only agent credential. Wire
# R_GBRAIN_URL plus static tokens into api/bullmq (operator-pinned), or the
# normal path: set GBRAIN_ADMIN_BOOTSTRAP_TOKEN below (>= 32 chars of
# [A-Za-z0-9_-]) and paste http://gbrain:8931 plus that same token into
# Settings > Integrations > Brain; Roomote then registers its own
# scoped clients via the admin API. If left unset, the entrypoint generates
# one at /data/admin-bootstrap-token on the volume.
gbrain:
profiles: [brain]
container_name: roomote-gbrain
build: .docker/gbrain
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
networks: [default]
environment:
GBRAIN_DATABASE_URL: postgres://postgres:password@postgres:5432/roomote_development
GBRAIN_ADMIN_BOOTSTRAP_TOKEN: ${GBRAIN_ADMIN_BOOTSTRAP_TOKEN:-}
# The Brain holds no provider key. It calls back into this deployment,
# which injects whichever provider key an admin configured in Settings,
# so rotating or switching that key needs no restart here. Setting a
# provider key below instead makes the Brain call the provider directly.
OPENAI_BASE_URL: ${GBRAIN_OPENAI_BASE_URL:-http://api:3001/api/brain/inference}
OPENAI_API_KEY: ${R_BRAIN_GATEWAY_TOKEN:-}
GBRAIN_RERANKER_MODEL: ${R_BRAIN_RERANKER_MODEL:-}
# Create-time, and it has to be the container that receives these: the
# embedding model and its width are decided when the Brain is created,
# and the gateway must never substitute a different one afterwards.
# Set both before the first boot, or neither. The synthesis model is
# the opposite (R_BRAIN_MODEL, applied by the gateway per request).
GBRAIN_EMBEDDING_MODEL: ${R_BRAIN_EMBEDDING_MODEL:-}
GBRAIN_EMBEDDING_DIMENSIONS: ${R_BRAIN_EMBEDDING_DIMENSIONS:-}
volumes:
- gbrain_data:/data
networks:
# The controller uses this network to discover the API and optional preview
# proxy. Each task gets a separate bridge network; only the API and an
# enabled preview proxy are attached to it, so task sandboxes never share a
# network with one another or with Postgres, Redis, or MinIO. The default
# network is implicit (roomote_default) and carries the datastores.
worker:
name: roomote_worker
driver: bridge
volumes:
gbrain_data:
name: roomote_gbrain_data