diff --git a/DOCKER_HUB.md b/DOCKER_HUB.md index deb0df2..e6fc59e 100644 --- a/DOCKER_HUB.md +++ b/DOCKER_HUB.md @@ -184,28 +184,27 @@ Understanding what survives container restarts and what doesn't: | `/home/developer/.ssh` | Host bind mount (ro) | ✅ Yes — lives on host | SSH keys | | `/home/developer/.aws` | Host bind mount | ✅ Yes — lives on host | AWS credentials/SSO cache | | `/home/developer/.local/share/opencode` | Named volume (if configured) | ✅ Yes — Docker volume | Session history, memory, auth tokens | -| `/home/developer/.config/opencode/opencode.json` | Generated by entrypoint | ❌ No — regenerated each start | Provider config, MCP server definitions | -| `/home/developer/.config/opencode/oh-my-opencode-slim.json` | Generated by entrypoint (OMOS variant) | ❌ No — regenerated each start | Agent/model mappings | +| `/home/developer/.config/opencode` | Host bind mount (if configured) | ✅ Yes — lives on host | opencode.json, oh-my-opencode-slim.json, skills | ### Key points - **Project files** (`/workspace`) are always safe — they're your host filesystem. -- **opencode config** is auto-generated from `OPENCODE_PROVIDER` env var on each start. It only sets provider and model — no MCP servers. To persist MCP server config, mount your own config file (see Custom opencode Config below). +- **opencode config** is auto-generated from `OPENCODE_PROVIDER` env var on each start if no existing config is found. To persist config changes, mount the config directory from the host (see Custom opencode Config below). - **opencode data** (session history, memory) is lost with `--rm` unless you add a named volume. - **AWS SSO tokens** persist across restarts when `~/.aws` is mounted (recommended for Bedrock users). ## Custom opencode Config -For full control (MCP servers, custom models, keybindings), mount your own config: +For full control over opencode settings (MCP servers, custom models, oh-my-opencode-slim agents, etc.), mount the entire config directory from the host: ```bash docker run -it --rm \ - -v ./my-opencode.json:/home/developer/.config/opencode/opencode.json:ro \ + -v ~/.config/opencode:/home/developer/.config/opencode \ ... \ joakimp/opencode-devbox:latest ``` -When a config file is mounted, the `OPENCODE_PROVIDER` auto-config is skipped. +This persists all configuration changes across container restarts. When an existing `opencode.json` is found, the `OPENCODE_PROVIDER` auto-config is skipped. ## Neovim Configuration @@ -257,10 +256,9 @@ services: - devbox-data:/home/developer/.local/share/opencode # Mount AWS config for Bedrock SSO (required for amazon-bedrock provider) # - ~/.aws:/home/developer/.aws - # Optional: mount your own opencode config (MCP servers, custom models, etc.) - # - ./opencode.json:/home/developer/.config/opencode/opencode.json:ro - # Optional: mount opencode skills from host - # - ~/.config/opencode/skills:/home/developer/.config/opencode/skills:ro + # Optional: mount opencode config directory (persists config changes across restarts) + # - ~/.config/opencode:/home/developer/.config/opencode + # Optional: mount opencode agent skills from host # - ~/.agents/skills:/home/developer/.agents/skills:ro # Optional: mount neovim config from host (plugins auto-install on first start) # - ~/.config/nvim:/home/developer/.config/nvim:ro @@ -347,15 +345,7 @@ On first start, the entrypoint configures oh-my-opencode-slim automatically. The ### Custom OMOS configuration -Mount your own config to control which models power each agent: - -```bash -docker run -it --rm \ - -e ENABLE_OMOS=true \ - -v ./oh-my-opencode-slim.json:/home/developer/.config/opencode/oh-my-opencode-slim.json:ro \ - ... \ - joakimp/opencode-devbox:latest-omos -``` +If you mount the opencode config directory (see Custom opencode Config above), the `oh-my-opencode-slim.json` file is included and persists across restarts. Edit it directly to control which models power each agent, fallback chains, council setup, and more. See the [oh-my-opencode-slim configuration docs](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/docs/configuration.md) for the full reference. diff --git a/README.md b/README.md index 8a94892..a418615 100644 --- a/README.md +++ b/README.md @@ -110,20 +110,21 @@ docker compose exec -u developer devbox aws --version ### Custom opencode config -Mount your own `opencode.json` for full control (MCP servers, custom models, etc.): +For full control over opencode settings (MCP servers, custom models, oh-my-opencode-slim agents, etc.), mount the entire config directory from the host: ```yaml volumes: - - ./my-opencode.json:/home/developer/.config/opencode/opencode.json:ro + - ~/.config/opencode:/home/developer/.config/opencode ``` +This persists all configuration changes across container restarts, including `opencode.json`, `oh-my-opencode-slim.json`, and skills. When an existing `opencode.json` is found, the `OPENCODE_PROVIDER` auto-config is skipped. + ### Custom skills -Mount your host's opencode skills into the container: +Mount agent skills from the host: ```yaml volumes: - - ~/.config/opencode/skills:/home/developer/.config/opencode/skills:ro - ~/.agents/skills:/home/developer/.agents/skills:ro ``` @@ -206,14 +207,9 @@ On first start, the entrypoint runs the oh-my-opencode-slim installer in non-int ### Custom Configuration -You can mount your own oh-my-opencode-slim config instead of using the auto-generated one: +If you mount the opencode config directory (see Custom opencode config above), the `oh-my-opencode-slim.json` file is included and persists across restarts. Edit it directly to control which models power each agent, fallback chains, council setup, and more. -```yaml -volumes: - - ./oh-my-opencode-slim.json:/home/developer/.config/opencode/oh-my-opencode-slim.json:ro -``` - -The config file controls which models power each agent, fallback chains, council setup, and more. See the [oh-my-opencode-slim configuration docs](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/docs/configuration.md) for the full reference. +See the [oh-my-opencode-slim configuration docs](https://github.com/alvinunreal/oh-my-opencode-slim/blob/master/docs/configuration.md) for the full reference. ### Verifying Agents @@ -314,7 +310,7 @@ Container (Debian bookworm) ├── opencode binary ├── oh-my-opencode-slim (optional — multi-agent orchestration plugin, includes Bun) ├── AWS CLI v2 (SSO + Bedrock auth) -├── neovim 0.12, tmux, htop, bat, eza, zoxide +├── neovim 0.12, tmux, htop, bat, eza, zoxide, make ├── git, ssh, ripgrep, fd, fzf, jq, curl, tree ├── Node.js (for MCP servers) ├── Bun (optional — included with oh-my-opencode-slim) @@ -330,10 +326,9 @@ Container (Debian bookworm) | `/home/developer/.ssh` | Host bind mount (ro) | ✅ Yes | SSH keys | | `/home/developer/.aws` | Host bind mount (if configured) | ✅ Yes | AWS credentials/SSO cache | | `/home/developer/.local/share/opencode` | Named volume `devbox-data` | ✅ Yes | Session history, memory | -| `/home/developer/.config/opencode/opencode.json` | Generated by entrypoint | ❌ No | Provider/model config | -| `/home/developer/.config/opencode/oh-my-opencode-slim.json` | Generated by entrypoint (if OMOS enabled) | ❌ No | Agent/model mappings | +| `/home/developer/.config/opencode` | Host bind mount (if configured) | ✅ Yes | opencode.json, oh-my-opencode-slim.json, skills | -**opencode config** (`opencode.json`) is auto-generated from `OPENCODE_PROVIDER` on each start. It sets provider and model only — no MCP servers. To use MCP servers or custom settings, mount your own config file (see Custom opencode config above). +**opencode config** (`opencode.json`) is auto-generated from `OPENCODE_PROVIDER` on each start. It sets provider and model only — no MCP servers. To persist config changes and use custom settings, mount the config directory from the host (see Custom opencode config above). ## License diff --git a/docker-compose.yml b/docker-compose.yml index 31291eb..ca4e9d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,16 +31,14 @@ services: # SSH keys (read-only) — for git push/pull - ${SSH_KEY_PATH:-~/.ssh}:/home/developer/.ssh:ro - # Optional: mount your own opencode config (MCP servers, custom models, etc.) - # - ./opencode.json:/home/developer/.config/opencode/opencode.json:ro + # Optional: mount opencode config directory (persists config changes across restarts) + # Includes opencode.json, oh-my-opencode-slim.json, skills, etc. + # When mounted, OPENCODE_PROVIDER auto-config is skipped if opencode.json exists. + # - ~/.config/opencode:/home/developer/.config/opencode - # Optional: mount opencode skills from host - # - ~/.config/opencode/skills:/home/developer/.config/opencode/skills:ro + # Optional: mount opencode agent skills from host # - ~/.agents/skills:/home/developer/.agents/skills:ro - # Optional: mount your own oh-my-opencode-slim config - # - ./oh-my-opencode-slim.json:/home/developer/.config/opencode/oh-my-opencode-slim.json:ro - # Optional: mount neovim config from host (plugins auto-install on first start) # - ~/.config/nvim:/home/developer/.config/nvim:ro