-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (64 loc) · 3.16 KB
/
Copy pathdocker-compose.yml
File metadata and controls
64 lines (64 loc) · 3.16 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
services:
agent:
build:
context: .
args:
# Per-deployment Debian apt mirror (domestic mirror for slow cross-border
# links); defaults to the upstream CDN when APT_MIRROR is unset.
APT_MIRROR: ${APT_MIRROR:-deb.debian.org}
# Optional npm registry mirror for faster npm install / npm ci during image builds.
NPM_REGISTRY: ${NPM_REGISTRY:-https://registry.npmjs.org/}
container_name: opencode-agent
# The bridge spawns the OpenCode server in-process (src/opencode-server.ts),
# so a single command runs both. bridge.sh execs tsx as PID 1 so Docker's
# SIGTERM reaches Node directly and graceful shutdown (which then stops the
# server child) fires.
command: ["bash", "scripts/bridge.sh"]
# Give the in-flight task time to finish and deliver before SIGKILL. Must
# exceed SHUTDOWN_DRAIN_TIMEOUT_MS below, with headroom for the model
# server to stop afterward.
stop_grace_period: 300s
env_file: .env
environment:
# The bridge binds the spawned server to this URL's host/port.
- OPENCODE_BASE_URL=http://127.0.0.1:4096
# Keep all runtime state under /workspace (never /root): redirect
# opencode's XDG dirs into the repo tree so the container is
# self-contained and the mounts below are uniform.
- XDG_DATA_HOME=/workspace/.local/share
- XDG_CONFIG_HOME=/workspace/.config
- XDG_CACHE_HOME=/workspace/.cache
- XDG_STATE_HOME=/workspace/.local/state
# Per-agent slug for the generated memory audit files; shared notes/ repo
# means each deployment writes its own SNAPSHOT.<id>.md to avoid conflicts.
- MEM0_AGENT_ID=vps
- BRIDGE_DISABLE_LOCK=true
- BROWSERBASE_REGION=ap-southeast-1
- GMAIL_NEWER_THAN=10m
# Upper bound on draining in-flight work on shutdown; keep < stop_grace_period.
- SHUTDOWN_DRAIN_TIMEOUT_MS=270000
# Optional: override the model set in .opencode/opencode.json per-deployment
- OPENCODE_MODEL=openai/gpt-5.4
- DEPLOY_COMMIT_SHA=${DEPLOY_COMMIT_SHA:-}
- DEPLOY_COMMIT_MESSAGE=${DEPLOY_COMMIT_MESSAGE:-}
- DEPLOY_RUN_ID=${DEPLOY_RUN_ID:-}
- DEPLOY_ACTOR=${DEPLOY_ACTOR:-}
- DEPLOYED_AT=${DEPLOYED_AT:-}
volumes:
# Persist only runtime data; app code and dependencies come from the image.
- ./.data:/workspace/.data
# Keep notes as a live host repo instead of baking them into the image.
- ./notes:/workspace/notes
# Credential/state dirs. Host sources are fixed under the project's
# .secrets/; container targets are under /workspace (matched by the
# XDG_* env above) so nothing lives in /root.
# - opencode-share: opencode's DATA dir — holds auth.json (incl. the
# openai OAuth tokens and other provider API keys). Required.
# No opencode CONFIG-dir mount: custom providers are injected in code
# (src/opencode-server-config.ts) and provider auth lives in auth.json
# above, so the global ~/.config/opencode/opencode.json is not needed.
- ./.secrets/opencode-share:/workspace/.local/share/opencode
ports:
- "4096:4096"
working_dir: /workspace
restart: unless-stopped