Skip to content

feat: Docker image + compose + GHCR build/publish#12

Merged
v0ropaev merged 1 commit into
masterfrom
feat/docker
Jun 21, 2026
Merged

feat: Docker image + compose + GHCR build/publish#12
v0ropaev merged 1 commit into
masterfrom
feat/docker

Conversation

@v0ropaev

Copy link
Copy Markdown
Owner

Containerizes knowbase: a slim runtime image (no torch) for the kb CLI / MCP stdio server, an optional -embed image (CPU-torch for kb embed + search), a docker-compose for local dev/eval, and a CI workflow that build-validates on PRs and publishes to GHCR on master (edge) and tags (semver + latest).

What

  • Dockerfile — multi-stage uv build, ARG EXTRAS (slim vs --extra embed), non-root user, OCI labels (incl. licenses=AGPL-3.0-or-later), ENTRYPOINT ["kb"]. Keeps the source tree at /app with an editable install because kb.store.migrate resolves migrations/ + db/*.sql via Path(__file__).parents[3] (the repo layout) — a bare wheel would break kb migrate. The embed variant adds libgomp1 (torch OpenMP); slim installs no apt packages.
  • .dockerignore, docker-compose.ymlpgvector/pgvector:pg17 db + a kb service; documented migrateindexserve flow; host pytest can reuse the compose Postgres via KB_TEST_DB_URL.
  • .github/workflows/docker.ymlhadolint + [slim, embed] matrix, setup-qemu/buildx, metadata-action tagging, push only off-PR, multi-arch amd64+arm64 for slim (embed amd64-only), gha cache.
  • kb migrate — applies the Alembic schema to head (--db-url / KB_DB_URL).
  • docs — README "Run with Docker" + GHCR badge; CHANGELOG.

Verification

  • kb migrate verified end-to-end against an ephemeral Postgres (schema applied); ruff + mypy --strict clean; 52 eval tests pass (+1 skipped); both new YAML files parse.
  • The Docker build is validated by this PR's docker.yml (no local Docker daemon in my env) — hadolint + building slim & embed (amd64, no push).

Post-merge (manual, one-time)

GHCR creates the package private on first push. After the first master build publishes :edge, set the package visibility to Public in GitHub → Packages → knowbase → settings (can't be done from the workflow). Releases (v* tags) then publish :X.Y.Z / :latest.

Containerize knowbase: a slim runtime image (no torch) for the kb CLI / MCP
stdio server, an optional -embed image with CPU-torch for `kb embed` + search,
a docker-compose for local dev/eval, and a CI workflow that build-validates on
PRs and publishes to GHCR on master (edge) and tags (semver + latest).

- Dockerfile: multi-stage uv build, ARG EXTRAS (slim vs --extra embed), non-root,
  OCI labels (AGPL). Keeps the source tree at /app with an editable install so
  kb.store.migrate's parents[3] resolution of migrations/ + db/*.sql works.
- .dockerignore, docker-compose.yml (pgvector db + kb; documented migrate/index/
  serve flow; host pytest can use the compose Postgres via KB_TEST_DB_URL).
- .github/workflows/docker.yml: hadolint + [slim, embed] matrix, buildx/QEMU,
  metadata-action tags, push only off-PR, multi-arch amd64+arm64 for slim
  (embed amd64-only), gha cache.
- feat(cli): `kb migrate` — apply the Alembic schema to head (--db-url / KB_DB_URL).
- docs: README "Run with Docker" + GHCR badge; CHANGELOG.

kb migrate verified end-to-end on an ephemeral Postgres; ruff + mypy --strict
clean; 52 eval tests pass (+1 skipped). Docker build is validated by the PR's
docker workflow (no local daemon here).
@v0ropaev v0ropaev merged commit 7bd3dff into master Jun 21, 2026
4 checks passed
@v0ropaev v0ropaev deleted the feat/docker branch June 21, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant