Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a87db23

Browse files
docs(README): Add Docker docs
- You can pull the mirror from the docker hub now.
1 parent 58d8fcc commit a87db23

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

‎README.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- [HTTPS and Certificate Generation](#https-and-certificate-generation)
2626
- [Plugins](#plugins)
2727
- [API Reference](#api-reference)
28+
- [Docker Deployment](#docker-deployment)
2829
- [CI/CD Pipeline](#cicd-pipeline)
2930
- [Contributing](#contributing)
3031
- [License](#license)
@@ -276,6 +277,41 @@ MCPServer++ provides basic support for the MCP Resources primitive, which allows
276277
}
277278
```
278279

280+
## Docker Deployment
281+
282+
### Build and Run
283+
1. **Multi-stage build** (Image size optimized to 10-15MB)
284+
```bash
285+
docker build -t mcp-server .
286+
docker run -p 6666:6666 -v $(pwd)/plugins:/plugins -v $(pwd)/certs:/certs mcp-server
287+
```
288+
289+
2. **HTTPS Configuration** (Certificate directory mounting required)
290+
```bash
291+
# Enable HTTPS by setting enable_https=1 in config.ini
292+
# Certificate files must be placed in /certs directory inside container
293+
docker run -p 6667:6667 -v $(pwd)/certs:/certs mcp-server
294+
```
295+
296+
### Plugin System
297+
- **Plugin Path Mapping**: Container plugin directory is `/plugins`, recommend mapping local directory via volume
298+
- **Plugin Loading**: Supports runtime hot-loading (ensure correct file permissions)
299+
300+
### Image Optimization
301+
- Based on minimal `gcr.io/distroless/cc-debian12` base image
302+
- Static linking + debug info stripping (LTO optimized)
303+
- Domestic users can configure mirror accelerators (see configuration examples)
304+
305+
## Docker Hub
306+
307+
Pre-built Docker images are available on Docker Hub: [https://hub.docker.com/r/mgzy/mcp-server](https://hub.docker.com/r/mgzy/mcp-server)
308+
309+
You can pull and run the latest image directly:
310+
```bash
311+
docker pull mgzy/mcp-server
312+
docker run -p 6666:6666 -v $(pwd)/plugins:/plugins -v $(pwd)/certs:/certs mgzy/mcp-server
313+
```
314+
279315
## CI/CD Pipeline
280316

281317
Our project uses GitHub Actions for continuous integration and deployment. The pipeline automatically builds and tests the server on multiple platforms:

‎README_zh.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,41 @@ MCPServer.cpp 支持强大的插件系统,允许在不修改核心服务器的
224224
}
225225
```
226226

227+
## Docker 部署
228+
229+
### 构建与运行
230+
1. **使用多阶段构建**(镜像体积优化至10-15MB)
231+
```bash
232+
docker build -t mcp-server .
233+
docker run -p 6666:6666 -v $(pwd)/plugins:/plugins -v $(pwd)/certs:/certs mcp-server
234+
```
235+
236+
2. **HTTPS 配置**(需挂载证书目录)
237+
```bash
238+
# 启用HTTPS需在config.ini设置 enable_https=1
239+
# 证书文件需放置在容器内/certs目录
240+
docker run -p 6667:6667 -v $(pwd)/certs:/certs mcp-server
241+
```
242+
243+
### 插件系统
244+
- **插件路径映射**:容器内插件目录为`/plugins`,建议通过volume映射本地插件目录
245+
- **插件加载**:支持运行时热加载插件(需确保插件文件权限正确)
246+
247+
### 镜像优化
248+
- 基于 `gcr.io/distroless/cc-debian12` 最小基础镜像
249+
- 启用静态链接+剥离调试信息(LTO优化)
250+
- 国内用户可配置镜像加速器(见文档底部配置示例)
251+
252+
## Docker Hub
253+
254+
预构建的 Docker 镜像可在 Docker Hub 获取:[https://hub.docker.com/r/mgzy/mcp-server](https://hub.docker.com/r/mgzy/mcp-server)
255+
256+
您可以直接拉取并运行最新镜像:
257+
```bash
258+
docker pull mgzy/mcp-server
259+
docker run -p 6666:6666 -v $(pwd)/plugins:/plugins -v $(pwd)/certs:/certs mgzy/mcp-server
260+
```
261+
227262
## CI/CD 流水线
228263

229264
我们的项目使用 GitHub Actions 进行持续集成和部署。流水线会自动在多个平台上构建和测试服务器:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /