-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
73 lines (71 loc) · 2.9 KB
/
docker-compose.yml
File metadata and controls
73 lines (71 loc) · 2.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
services:
opencode:
build:
context: .
dockerfile: Dockerfile.opencode
volumes:
- ./memory:/workspace/memory
- opencode-config:/root/.config/opencode
# Anything the user installs from inside the container with
# `npm install -g <pkg>` lands in /root/.npm-global (we configure
# npm's prefix to that path in Dockerfile.opencode). Mounted as a
# named volume so installs survive `docker compose up -d --build`.
- opencode-npm:/root/.npm-global
# Same idea for `pip install --user <pkg>`. /root/.local/bin is in
# PATH, so user-installed Python tools are immediately runnable.
- opencode-pip:/root/.local
environment:
# The opencode-entrypoint.sh writes opencode.json based on this URL
# so OpenCode automatically discovers the bot's memory MCP server.
- ASSISTANT_MEMORY_MCP_URL=http://bot:4097/mcp
# Pull any MCP_URL_* env vars from the user's .env file. Each one
# registers an additional remote MCP server in opencode.json. See
# docs/MCP_INTEGRATION.md for the supported pattern (e.g.
# MCP_URL_PLAYLIST_CURATOR=http://host.docker.internal:4098/mcp).
env_file: .env
# Let OpenCode reach MCP servers running on the host (e.g.
# playlist-curator-mcp). Harmless when unused.
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
bot:
condition: service_started
restart: unless-stopped
bot:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./memory:/app/memory
- bot-data:/app/data
# Persists Baileys auth state so WhatsApp doesn't need a new QR
# scan on every `docker compose up -d --build`. Only used when
# WHATSAPP_ENABLED=true; harmless otherwise.
- whatsapp-auth:/app/data/whatsapp-auth
env_file: .env
environment:
# Pin the bot's data home (settings.json, scheduled tasks, logs,
# service state) into /app/data which is a persistent named volume.
# Without this override the bot defaults to /root/.config/
# opencode-assistant/ — that path is INSIDE the container's
# writable layer, so every `docker compose up -d --build`
# (e.g. via `opencode-assistant --update`) wipes it and the
# user's scheduled tasks vanish. See src/runtime/paths.ts.
- OPENCODE_ASSISTANT_HOME=/app/data
# Lets the bot reach services running on the VPS host (e.g. an
# Ollama install for the optional vector memory). Harmless when
# unused — it only adds a /etc/hosts alias inside the container.
# Requires Docker 20.10+ (released 2020-12).
extra_hosts:
- "host.docker.internal:host-gateway"
# MCP HTTP server is exposed only on the compose network (no host port
# mapping). OpenCode reaches it at http://bot:4097/mcp.
expose:
- "4097"
restart: unless-stopped
volumes:
opencode-config:
opencode-npm:
opencode-pip:
bot-data:
whatsapp-auth: