|
| 1 | +--- |
| 2 | +title: "Collaborator readiness and containerized development" |
| 3 | +summary: "Spec and plan for making the repo easier to hand to collaborators with a consistent Docker-backed source workflow" |
| 4 | +read_when: |
| 5 | + - Adding collaborators to the OpenClaw repository |
| 6 | + - Setting up source development in a container |
| 7 | + - Reviewing the current Docker and contributor handoff state |
| 8 | +--- |
| 9 | + |
| 10 | +## Status |
| 11 | + |
| 12 | +First-pass implementation. |
| 13 | + |
| 14 | +The repository already had a production-oriented Docker runtime through the root |
| 15 | +`Dockerfile` and `docker-compose.yml`. This plan adds the missing collaborator |
| 16 | +handoff layer: a concise root context file, a source-development container, and |
| 17 | +docs that explain when to use the dev container versus the production image. |
| 18 | + |
| 19 | +## Goal |
| 20 | + |
| 21 | +Make the repository safe and fast to hand to new collaborators by giving them |
| 22 | +clear context, the canonical operating rules, and a reproducible Linux source |
| 23 | +environment. |
| 24 | + |
| 25 | +## Non-goals |
| 26 | + |
| 27 | +- Do not replace the production Dockerfile with a development image. |
| 28 | +- Do not pick a production hosting provider in this pass. |
| 29 | +- Do not move secrets, auth profiles, or local OpenClaw state into the repo. |
| 30 | +- Do not change product behavior, plugin contracts, gateway protocol, or build |
| 31 | + outputs. |
| 32 | + |
| 33 | +## Current state |
| 34 | + |
| 35 | +- `README.md` and `CONTRIBUTING.md` explain source setup and contribution |
| 36 | + rules, but the repo did not have a short current-state handoff file for |
| 37 | + collaborators and agents. |
| 38 | +- `AGENTS.md` is the canonical repo policy file, with scoped `AGENTS.md` files |
| 39 | + under docs, scripts, source, plugins, UI, and tests. |
| 40 | +- The root `Dockerfile` is a multi-stage runtime image intended for production, |
| 41 | + release validation, and packaged gateway execution. |
| 42 | +- `docker-compose.yml` runs production-shaped `openclaw-gateway` and |
| 43 | + `openclaw-cli` services against the built image. |
| 44 | +- Source development still needed a lightweight container entry point that |
| 45 | + mounts the repo and runs `pnpm` commands in a consistent Node Linux |
| 46 | + environment without adding service sidecars. |
| 47 | +- Fresh source containers needed an explicit local gateway config stamp before |
| 48 | + the watcher could start cleanly on a host-published port. |
| 49 | + |
| 50 | +## Spec |
| 51 | + |
| 52 | +The collaborator-ready repo should provide three clear paths: |
| 53 | + |
| 54 | +1. Local source development for contributors who already have Node and pnpm. |
| 55 | +2. Source development inside Docker for collaborators who want the same Linux |
| 56 | + toolchain and dependency layout. |
| 57 | +3. Production-shaped Docker runtime for deployment and release-path validation. |
| 58 | + |
| 59 | +The source-development container must: |
| 60 | + |
| 61 | +- Use Node 24, matching the recommended source runtime. |
| 62 | +- Use the repo-pinned `packageManager` through Corepack. |
| 63 | +- Mount the checkout at `/workspace`. |
| 64 | +- Keep container dependency caches in Docker volumes. |
| 65 | +- Keep local OpenClaw state under the repo ignored `.local/` directory by |
| 66 | + default. |
| 67 | +- Define exactly one source-development service and no sidecar containers. |
| 68 | +- Expose only the Gateway and Vite UI ports used by the normal dev loop. |
| 69 | +- Persist `gateway.mode=local`, `gateway.bind=lan`, `gateway.port=18789`, |
| 70 | + token auth, and matching Gateway and Vite Control UI origins during first-run |
| 71 | + setup. |
| 72 | +- Stay separate from the production Dockerfile so deploy images remain minimal. |
| 73 | + |
| 74 | +The documentation must: |
| 75 | + |
| 76 | +- Point collaborators first to `PROJECT_CONTEXT.md`, `README.md`, |
| 77 | + `CONTRIBUTING.md`, and `AGENTS.md`. |
| 78 | +- Explain when to use `Dockerfile.dev` versus the root `Dockerfile`. |
| 79 | +- Keep Docker install docs focused on the deployable gateway path while linking |
| 80 | + source development back to setup docs. |
| 81 | + |
| 82 | +## Implementation plan |
| 83 | + |
| 84 | +1. Add `PROJECT_CONTEXT.md` at the repo root with the current state, entry |
| 85 | + points, container paths, agent rules, and open decisions. |
| 86 | +2. Add `Dockerfile.dev` for a source-development image based on Node 24 with |
| 87 | + Corepack, pnpm, Git, Python, build tools, and `tini`. |
| 88 | +3. Add `docker-compose.dev.yml` with a single `openclaw-dev` service that |
| 89 | + mounts the repo, persists pnpm and Node dependency volumes, maps Gateway |
| 90 | + ports, and defaults to a shell. |
| 91 | +4. Add `scripts/docker/dev-setup.sh` to install dependencies, generate or reuse |
| 92 | + local token auth, and persist the local gateway config required by |
| 93 | + containerized source development. |
| 94 | +5. Add `scripts/docker/dev-token.sh` to print the local dev token explicitly |
| 95 | + without making first-run setup echo secrets by default. |
| 96 | +6. Add `.devcontainer/devcontainer.json` so VS Code and compatible tools can |
| 97 | + open the same Compose-backed source container. |
| 98 | +7. Update `README.md`, `docs/start/setup.md`, and `docs/install/docker.md` to |
| 99 | + describe the source-development container and distinguish it from the |
| 100 | + production Docker path. |
| 101 | +8. Update `.github/labeler.yml` so Docker-related dev container changes route |
| 102 | + to the Docker label. |
| 103 | +9. Verify docs formatting and the container smoke path before publishing the |
| 104 | + branch. |
| 105 | + |
| 106 | +## Remaining decisions |
| 107 | + |
| 108 | +- Choose the actual production host and deployment model. |
| 109 | +- Decide whether collaborators should use GitHub Codespaces in addition to the |
| 110 | + local dev container. |
| 111 | +- Decide whether to publish a prebuilt dev image or keep building it locally |
| 112 | + from `Dockerfile.dev`. |
| 113 | +- Decide which broad Docker or release-path Testbox lane should become the |
| 114 | + final gate before merging this branch. |
0 commit comments