Skip to content

feat(deploy): Docker 化 KIP dashboard,实现开机自启 - #20

Merged
surenny merged 1 commit into
surenny:mainfrom
Camille1024:feat/dockerize-dashboard-aut-42
Apr 30, 2026
Merged

feat(deploy): Docker 化 KIP dashboard,实现开机自启#20
surenny merged 1 commit into
surenny:mainfrom
Camille1024:feat/dockerize-dashboard-aut-42

Conversation

@Camille1024

Copy link
Copy Markdown
Collaborator

完成了什么

将 KIP dashboard(ui/)容器化,使其和现有的 kip-server(leanblueprint serve)一样,通过 docker-compose 管理,服务器重启后自动拉起,不再依赖手动启动命令。

新增文件

ui/Dockerfile — dashboard 的三阶段构建:

  1. client-builder:用 Vite 构建 React 前端,输出 dist/
  2. server-builder:用 tsc 编译 Fastify 后端,输出 dist/
  3. 运行时镜像:node:22-slim + Graphviz(DAG 渲染必需),体积最小

docker-compose.yml — 定义两个服务:

  • kip-server:原有的 leanblueprint serve(端口 8082),restart: unless-stopped
  • dashboard:新增 dashboard 服务(端口 18080),挂载项目根目录为 /projectrestart: unless-stopped

Dockerfile — 恢复 leanblueprint serve 的构建文件(原本只在 feat/unify-annotation-system 分支上,main 分支缺失)

部署效果

  • kip.opensii.ai/dashboard/ 现已通过 docker-compose 稳定运行
  • 服务器重启后 dashboard 自动恢复,无需人工干预
  • 进程崩溃后 Docker 自动重启

本地验证

docker compose up -d dashboard
curl http://localhost:18080/api/state/health
# → {"ok":true,"counts":{"nodes":239,"edges":321,...}}

背景

关联 issue:#18(跨主机日志上报)、#19(分布式 agent 调度)

Add ui/Dockerfile (multi-stage Node.js build) and restore Dockerfile +
docker-compose.yml so the dashboard runs as a managed container alongside
the existing kip-server, with restart: unless-stopped.

- ui/Dockerfile: three-stage build (client-builder → server-builder →
  runtime). Client built with Vite, server compiled with tsc, runtime
  image is node:22-slim + graphviz. Client dist lands at /app/client/dist
  so server/dist/index.js's ../../client/dist path resolves correctly.
- docker-compose.yml: adds dashboard service (port 18080:8081), mounts
  project root as /project so the server can read agents/, blueprint/,
  .kip/state.db, and KIP/*.lean at runtime.
- Dockerfile: restored leanblueprint serve container (was only on
  feat/unify-annotation-system, not on main).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@surenny
surenny merged commit a4bc92d into surenny:main Apr 30, 2026
1 check passed
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.

3 participants