Skip to content

feat: Dockerized release for non-JS environments#41

Draft
hustcc with Copilot wants to merge 2 commits into
mainfrom
copilot/add-dockerfile-for-integration
Draft

feat: Dockerized release for non-JS environments#41
hustcc with Copilot wants to merge 2 commits into
mainfrom
copilot/add-dockerfile-for-integration

Conversation

Copilot AI commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Issue #34 requests a Docker-based distribution to make mcp-mermaid usable outside Node.js environments. This adds a publish pipeline and cleans up the existing Dockerfile.

Changes

  • Dockerfile: Added EXPOSE 3033 and a default CMD — container now serves SSE on port 3033 with no extra arguments required:

    docker run -p 3033:3033 ghcr.io/hustcc/mcp-mermaid:latest
  • .github/workflows/docker.yml: New workflow publishing to GitHub Container Registry (ghcr.io/hustcc/mcp-mermaid) on pushes to main and v* tags. Produces latest, branch, and semver (x.y.z / x.y) tags with GHA layer caching.

  • README.md: Updated Docker section to reference the canonical ghcr.io/hustcc/mcp-mermaid image (replacing the personal susuperli/ namespace), added MCP client config snippet for Docker-hosted SSE, and added local build instructions.

    {
      "mcpServers": {
        "mcp-mermaid": {
          "url": "http://localhost:3033/sse"
        }
      }
    }
Original prompt

The issue #34 requests the addition of a Dockerized version of the project to make integration into non-JS environments easier. Adding a Dockerfile and necessary setups will enable this functionality. We need to create a Dockerfile that includes all the dependencies required to run the project, along with instructions on how to build and use the image. The Dockerized version should ensure compatibility and ease of integration. Steps to address the issue include creating a Dockerfile, ensuring proper build functionality, and including documentation for users.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: 来一个 pr 解决

Assistant: 请问您希望我针对哪个方面来解决这个 issue?您可以提供一些具体的信息,例如问题的描述、需要解决的任务或想要实现的功能。如果该 issue 已经有具体的内容,我也可以查阅后直接给出解决方案的建议。

User: 这个 issue

Assistant: Issue #34 是关于 发布一个 Docker 版本 的请求,具体内容是:

请将 Docker 版本添加到下一个版本中!这将使其更容易集成到非 JS 环境中。

下一步我们计划创建一个 PR 来解决此需求,您是否有更多关于 Docker 配置或发布流程的具体要求?

User: 没有

Assistant: 已创建一个针对 Issue #34 的 Pull Request,具体包括添加 Docker 化的功能和相关文档。您可以在仓库中检查并进一步处理。

This pull request was created from Copilot chat.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Add Dockerized version of the project for easier integration feat: Dockerized release for non-JS environments Mar 28, 2026
Copilot AI requested a review from hustcc March 28, 2026 00:28
@hustcc
hustcc requested review from Copilot and removed request for hustcc March 28, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Docker-based distribution and publishing pipeline so mcp-mermaid can be run as a container (SSE by default) and consumed outside Node.js-centric environments, addressing Issue #34.

Changes:

  • Update Docker usage docs to reference the canonical ghcr.io/hustcc/mcp-mermaid image and add MCP client + local build examples.
  • Extend Dockerfile to expose port 3033 and provide a default SSE CMD.
  • Add a GitHub Actions workflow to build and publish Docker images to GitHub Container Registry on main pushes and v* tags.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
README.md Switch docs to GHCR image, add Docker-based SSE client config + local build instructions.
Dockerfile Default container behavior to serve SSE on 3033 via CMD, and expose 3033.
.github/workflows/docker.yml New CI workflow to build/push container images with metadata tags and GHA caching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +7
on:
push:
branches: [main]
tags:
- 'v*'

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow only runs on pushes/tags and immediately pushes images; Dockerfile breakages won’t be detected until after merge. Consider adding a pull_request trigger that runs the same build steps with push: false (and optionally load: true) so Docker build failures are caught in CI before publishing.

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile
Comment on lines 5 to +9
COPY . .

RUN npm install --ignore-scripts \
&& npm run build \
&& npx playwright install --with-deps chromium \
&& apt-get clean \
&& npm prune --omit=dev \
&& npm cache clean --force \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/*
&& npm run build \
&& npx playwright install --with-deps chromium \

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker build caching is inefficient because COPY . . happens before npm install, so any source change invalidates the dependency layer and forces a full reinstall. Consider copying only package.json/lockfile first, running the install, then copying the rest of the source before npm run build.

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile
Comment on lines 5 to 7
COPY . .

RUN npm install --ignore-scripts \

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This single-stage Docker build keeps the full repository (e.g., src/, tests, configs) in the final runtime image, increasing size and attack surface. Consider a multi-stage build (builder + runtime) that copies only build/ plus production dependencies into the final image, or explicitly remove source/test files after the build step.

Copilot uses AI. Check for mistakes.
Comment thread Dockerfile
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/*

EXPOSE 3033

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image documents running streamable transport on port 1122, but the Dockerfile only exposes 3033. If you want docker run -P and tooling to work consistently for streamable mode too, consider also exposing 1122 (or documenting that 1122 must always be mapped explicitly).

Suggested change
EXPOSE 3033
EXPOSE 3033
EXPOSE 1122

Copilot uses AI. Check for mistakes.
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