Skip to content

Commit 2257135

Browse files
Copilothustcc
andauthored
feat: add Docker support with GHCR publish workflow and updated docs
Agent-Logs-Url: https://github.com/hustcc/mcp-mermaid/sessions/a464b1d1-980b-4c44-b630-5eacef975b8e Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
1 parent a4f8773 commit 2257135

3 files changed

Lines changed: 85 additions & 13 deletions

File tree

.github/workflows/docker.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: docker
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Log in to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Extract metadata
28+
id: meta
29+
uses: docker/metadata-action@v5
30+
with:
31+
images: ghcr.io/${{ github.repository }}
32+
tags: |
33+
type=ref,event=branch
34+
type=semver,pattern={{version}}
35+
type=semver,pattern={{major}}.{{minor}}
36+
type=raw,value=latest,enable={{is_default_branch}}
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Build and push
42+
uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ WORKDIR /app
55
COPY . .
66

77
RUN npm install --ignore-scripts \
8-
&& npm run build \
9-
&& npx playwright install --with-deps chromium \
10-
&& apt-get clean \
11-
&& npm prune --omit=dev \
12-
&& npm cache clean --force \
13-
&& rm -rf /var/lib/apt/lists/* \
14-
&& rm -rf /var/cache/apt/*
8+
&& npm run build \
9+
&& npx playwright install --with-deps chromium \
10+
&& apt-get clean \
11+
&& npm prune --omit=dev \
12+
&& npm cache clean --force \
13+
&& rm -rf /var/lib/apt/lists/* \
14+
&& rm -rf /var/cache/apt/*
15+
16+
EXPOSE 3033
1517

1618
ENTRYPOINT ["node", "build/index.js"]
19+
20+
CMD ["--transport", "sse", "--port", "3033"]

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ Also, you can use it on aliyun, modelscope, glama.ai, smithery.ai or others with
5959
- SSE: `http://localhost:3033/sse`
6060
- Streamable: `http://localhost:1122/mcp`
6161

62-
**Available Docker Tags:**
63-
- `susuperli/mcp-mermaid:latest` - Latest stable version
64-
- View all available tags at [Docker Hub](https://hub.docker.com/repository/docker/susuperli/mcp-mermaid/tags)
62+
**Available Docker Images:**
63+
- `ghcr.io/hustcc/mcp-mermaid:latest` - Latest stable version (GitHub Container Registry)
64+
- View all available tags at [GitHub Container Registry](https://github.com/hustcc/mcp-mermaid/pkgs/container/mcp-mermaid)
6565

6666

6767
## 🚰 Run with SSE or Streamable transport
@@ -174,13 +174,32 @@ Run MCP Mermaid with Docker:
174174

175175
```bash
176176
# Pull the image
177-
docker pull susuperli/mcp-mermaid:latest
177+
docker pull ghcr.io/hustcc/mcp-mermaid:latest
178178

179179
# Run with SSE transport (default)
180-
docker run -p 3033:3033 susuperli/mcp-mermaid:latest --transport sse
180+
docker run -p 3033:3033 ghcr.io/hustcc/mcp-mermaid:latest
181181

182182
# Run with streamable transport
183-
docker run -p 1122:1122 susuperli/mcp-mermaid:latest --transport streamable --port 1122
183+
docker run -p 1122:1122 ghcr.io/hustcc/mcp-mermaid:latest --transport streamable --port 1122
184+
```
185+
186+
Use it as an MCP server over SSE in your MCP client configuration:
187+
188+
```json
189+
{
190+
"mcpServers": {
191+
"mcp-mermaid": {
192+
"url": "http://localhost:3033/sse"
193+
}
194+
}
195+
}
196+
```
197+
198+
To build the image locally from source:
199+
200+
```bash
201+
docker build -t mcp-mermaid .
202+
docker run -p 3033:3033 mcp-mermaid
184203
```
185204

186205
## 📄 License

0 commit comments

Comments
 (0)