feat: unified Docker workspace mount with supervised daemon#135
Merged
feat: unified Docker workspace mount with supervised daemon#135
Conversation
Reshape the Docker experience around a single bind mount and a single named volume. Global settings live on the host under $HOME/.cocoindex_code/ (visible and editable); index data and the model cache persist in one cocoindex-data volume; daemon runtime state stays on the container's native filesystem. CLI and MCP output now show host-side paths via a bidirectional COCOINDEX_CODE_HOST_PATH_MAPPING translator. A shell wrapper that forwards $PWD (COCOINDEX_CODE_HOST_CWD) lets ccc work from any project subdirectory on the host. The daemon tolerates a missing global_settings.yml (starts in no-settings mode) so ccc init's interactive picker works in Docker on first run. A supervisor restart loop in the entrypoint, driven by a new COCOINDEX_CODE_DAEMON_SUPERVISED contract, makes settings-change auto-restart safe — editing global_settings.yml triggers an in-place daemon respawn without taking the container down. Linux ownership alignment via PUID/PGID, gosu privilege drop, and a coco user baked into the image. Release workflow now publishes to both Docker Hub (cocoindex/cocoindex-code) and GHCR (ghcr.io/cocoindex-io/cocoindex-code). Also: - Merge cocoindex-db and cocoindex-model-cache into a single volume - find_parent_with_marker requires .cocoindex_code/settings.yml, so a workspace-root global-only dir doesn't trigger nested-init warnings - New pytest marker `docker_e2e` gates the Docker-backed E2E suite (excluded from default pytest runs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #128.
Summary
$HOME/.cocoindex_code/global_settings.yml(visible, editable, nodocker exec catdance). Index databases and the pre-baked model cache share onecocoindex-datavolume; daemon runtime state (daemon.sock/daemon.pid/daemon.log) stays on the container's native FS.COCOINDEX_CODE_HOST_PATH_MAPPING) and a host-pwd forwarding env var (COCOINDEX_CODE_HOST_CWD) so CLI output and MCP results show host-side paths andcd+cccworks from any project under the mounted workspace.global_settings.yml(starts in "no-settings" mode), the entrypoint runs a restart loop with signal forwarding, and the client branches on a newCOCOINDEX_CODE_DAEMON_SUPERVISEDenv var —stop_daemon()then wait, nostart_daemon()race. Non-Docker behavior unchanged.PUID/PGIDentrypoint pattern withgosuso files written to the bind mount on Linux are owned by the host user, not root.docker/docker-compose.ymlwires this as a one-command quickstart.cocoindex/cocoindex-code) and GHCR (mirror,ghcr.io/cocoindex-io/cocoindex-code). GHCR swap is documented as a one-line README change.Test plan
uv run mypy .— no issues in 35 source filesuv run pytest tests/— 147 passed, 8 deselected bydocker_e2emarkeruv run pytest -m docker_e2e— 6 passed, 2 Linux-only PUID tests skipped on macOS (covers index+search, host-cwd forwarding valid/invalid, baked-model-no-redownload, settings-change supervised restart,docker compose upsmoke)Pre-merge setup owners need to do:
docker-hubGitHub environment withDOCKERHUB_USERNAME/DOCKERHUB_TOKENsecrets (workflow already references it)GITHUB_TOKENto write packages (for GHCR push)🤖 Generated with Claude Code