feat: add optional home volume and extra mounts

This commit is contained in:
Gabriel Trigo
2026-01-10 20:12:23 +00:00
committed by Peter Steinberger
parent 56b11ad5a8
commit b5cd758c21
3 changed files with 128 additions and 8 deletions

View File

@@ -61,6 +61,51 @@ docker compose run --rm clawdbot-cli onboard
docker compose up -d clawdbot-gateway
```
### Extra mounts (optional)
If you want to mount additional host directories into the containers, set
`CLAWDBOT_EXTRA_MOUNTS` before running `docker-setup.sh`. This accepts a
comma-separated list of Docker bind mounts and applies them to both
`clawdbot-gateway` and `clawdbot-cli` by generating `docker-compose.extra.yml`.
Example:
```bash
export CLAWDBOT_EXTRA_MOUNTS="$HOME/.codex:/home/node/.codex:ro,$HOME/github:/home/node/github:rw"
./docker-setup.sh
```
Notes:
- Paths must be shared with Docker Desktop on macOS/Windows.
- If you edit `CLAWDBOT_EXTRA_MOUNTS`, rerun `docker-setup.sh` to regenerate the
extra compose file.
### Persist the entire container home (optional)
If you want `/home/node` to persist across container recreation, set a named
volume via `CLAWDBOT_HOME_VOLUME`. This creates a Docker volume and mounts it at
`/home/node`, while keeping the standard config/workspace bind mounts.
Example:
```bash
export CLAWDBOT_HOME_VOLUME="clawdbot_home"
./docker-setup.sh
```
You can combine this with extra mounts:
```bash
export CLAWDBOT_HOME_VOLUME="clawdbot_home"
export CLAWDBOT_EXTRA_MOUNTS="$HOME/.codex:/home/node/.codex:ro,$HOME/github:/home/node/github:rw"
./docker-setup.sh
```
Notes:
- If you change `CLAWDBOT_HOME_VOLUME`, rerun `docker-setup.sh` to regenerate the
extra compose file.
- The named volume persists until removed with `docker volume rm <name>`.
### Faster rebuilds (recommended)
To speed up rebuilds, order your Dockerfile so dependency layers are cached.