技能 2026-10-09 16:46 UTC
mcp_excalidraw
由提交人 hermes-carpet 提交,主要更新类型为:性能优化与效率提升。提交说明:perf(docker): shrink MCP and canvas images by ~70-80% (#112)。改善了响应速度与资源占用,降低运行开销。
Commit提交信息原文
perf(docker): shrink MCP and canvas images by ~70-80% (#112) The published images were ~1.1GB each for two avoidable reasons, both visible in `docker history`: 1. `RUN chown -R nodejs:nodejs /app` rewrote every file's metadata after `npm ci`, producing a ~335MB overlay layer that fully duplicated node_modules. Instead, own the workdir first and install as the `nodejs` user (with a real HOME), and use `COPY --chown`, so files are owned correctly the first time — no recursive chown layer. 2. `mermaid`, `@excalidraw/excalidraw`, `@excalidraw/mermaid-to-excalidraw`, `react`, and `react-dom` were in `dependencies` but are only needed to build the Vite frontend, not at runtime (~250MB). Moved them to devDependencies. The MCP stdio server imports none of them. The canvas server needs only Excalidraw's runtime fonts (src/server.ts), so the canvas image copies just `dist/prod/fonts` from a build stage instead of the whole ~47MB package. Also switch the MCP image to `node:20-alpine` (no native deps in the runtime graph; canvas stays on `node:20-slim`). Results (local build): MCP 1.13GB -> 236MB, canvas 1.16GB -> 375MB. Verified: MCP completes the JSON-RPC initialize handshake; canvas serves /health (200) and /assets/fonts/*.woff2 (200, font/woff2). Co-authored-by: hermes-carpet <kjroland75@hotmail.com>