Skip to content

Commit a7614bc

Browse files
committed
docs(docker): 统一 Docker 配置为 bundle 版本
- 删除 Dockerfile.bundle,Dockerfile 现在就是 bundle 版本 - 删除 docker-compose.bundle.yml,统一使用 docker-compose.yml - 删除 Dockerfile.local,不再需要 - 删除 docs/DOCKER_BUNDLE.md,内容已合并到 DEPLOYMENT.md 主要改动: - Dockerfile: 使用单文件 bundle,零依赖部署 - docker-compose.yml: 简化配置,移除不必要选项 - docs/DEPLOYMENT.md: 更新 Docker 部署说明,强调 bundle 优势 - README.md: 添加单文件 bundle 特性说明 Docker 优势: - 镜像大小: ~193 MB (vs 传统 ~250 MB) - 构建时间: ~10 秒 (vs 传统 ~2 分钟) - 零运行时依赖,启动更快
1 parent 4f3a698 commit a7614bc

8 files changed

Lines changed: 88 additions & 480 deletions

File tree

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
FROM node:20-alpine
22

3-
# 设置工作目录
3+
# 单文件 Bundle 部署 - 极简版本
4+
# 优势:无需 npm install,启动更快,镜像更小
5+
46
WORKDIR /app
57

6-
# 安装 MCP Server
7-
RUN npm install -g @mikoto_zero/minigame-open-mcp@latest
8+
# 只复制单文件 bundle(无需 node_modules)
9+
COPY dist/server-bundle.js /app/server.js
810

911
# 健康检查
1012
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
@@ -16,13 +18,13 @@ EXPOSE 3000
1618
# 环境变量(可在 docker run 时覆盖)
1719
ENV TAPTAP_MCP_TRANSPORT=sse
1820
ENV TAPTAP_MCP_PORT=3000
19-
ENV TAPTAP_MCP_ENV=rnd
21+
ENV TAPTAP_MCP_ENV=production
2022
ENV TAPTAP_MCP_VERBOSE=false
2123
ENV TAPTAP_MCP_CACHE_DIR=/var/lib/taptap-mcp/cache
2224
ENV TAPTAP_MCP_TEMP_DIR=/tmp/taptap-mcp/temp
2325

2426
# 创建缓存和临时目录
2527
RUN mkdir -p /var/lib/taptap-mcp/cache /tmp/taptap-mcp/temp
2628

27-
# 启动命令
28-
CMD ["sh", "-c", "minigame-open-mcp"]
29+
# 启动命令(直接运行单文件)
30+
CMD ["node", "/app/server.js"]

Dockerfile.bundle

Lines changed: 0 additions & 31 deletions
This file was deleted.

Dockerfile.local

Lines changed: 0 additions & 38 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> 基于 Model Context Protocol (MCP) 的 **TapTap 小游戏和 H5 游戏**服务器 - 提供排行榜文档和管理 API,支持 **OAuth 2.0 零配置认证**
44
5-
🔐 **零配置 OAuth** | 📚 **完整文档** | 🎯 **19 Tools + 7 Resources** | 🌍 **小游戏 & H5**
5+
🔐 **零配置 OAuth** | 📚 **完整文档** | 🎯 **19 Tools + 7 Resources** | 🌍 **小游戏 & H5** | 📦 **单文件 Bundle**
66

77
## ✨ 核心特性
88

@@ -12,6 +12,7 @@
1212
- **🎮 H5 游戏支持** - 上传、发布、状态查询
1313
- **🚀 三种传输模式** - stdio(本地)、SSE(远程/实时)、HTTP(兼容)
1414
- **🔌 多客户端并发** - 独立会话管理,无限并发
15+
- **📦 单文件 Bundle** - 零依赖,包体积减少 96%(567 KB)
1516

1617
**NPM**: [@mikoto_zero/minigame-open-mcp](https://www.npmjs.com/package/@mikoto_zero/minigame-open-mcp)
1718

docker-compose.bundle.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

docker-compose.yml

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,48 @@
11
version: '3.8'
22

33
services:
4-
# TapTap MCP Server(独立服务)
54
taptap-mcp-server:
6-
image: taptap-mcp-server:1.4.10-local
75
build:
86
context: .
9-
dockerfile: Dockerfile.local
7+
dockerfile: Dockerfile
8+
image: taptap-mcp-server:latest
109
container_name: taptap-mcp-server
1110
restart: unless-stopped
12-
13-
# 网络配置
1411
ports:
15-
- "5003:3000" # 主机端口:容器端口
16-
17-
# 环境变量
12+
- "3000:3000"
1813
environment:
19-
# 传输模式
20-
- TAPTAP_MCP_TRANSPORT=sse
21-
- TAPTAP_MCP_PORT=3000
22-
23-
# TapTap 环境
24-
- TAPTAP_MCP_ENV=${TAPTAP_MCP_ENV:-rnd} # rnd | production
25-
26-
# 客户端配置(必需)
27-
- TAPTAP_MCP_CLIENT_ID=${TAPTAP_MCP_CLIENT_ID}
28-
- TAPTAP_MCP_CLIENT_SECRET=${TAPTAP_MCP_CLIENT_SECRET}
29-
30-
# 路径配置
31-
- WORKSPACE_ROOT=/workspace
32-
14+
# 传输协议
15+
TAPTAP_MCP_TRANSPORT: sse
16+
TAPTAP_MCP_PORT: 3000
17+
18+
# API 环境
19+
TAPTAP_MCP_ENV: production
20+
21+
# 认证信息(必填)
22+
TAPTAP_MCP_CLIENT_ID: ${TAPTAP_MCP_CLIENT_ID}
23+
TAPTAP_MCP_CLIENT_SECRET: ${TAPTAP_MCP_CLIENT_SECRET}
24+
# TAPTAP_MCP_MAC_TOKEN: ${TAPTAP_MCP_MAC_TOKEN} # 可选,如果有预设 token
25+
26+
# 缓存和临时目录
27+
TAPTAP_MCP_CACHE_DIR: /var/lib/taptap-mcp/cache
28+
TAPTAP_MCP_TEMP_DIR: /tmp/taptap-mcp/temp
29+
3330
# 日志
34-
- TAPTAP_MCP_VERBOSE=${TAPTAP_MCP_VERBOSE:-true}
35-
36-
# 缓存和临时文件目录
37-
- TAPTAP_MCP_CACHE_DIR=/var/lib/taptap-mcp/cache
38-
- TAPTAP_MCP_TEMP_DIR=/tmp/taptap-mcp/temp
39-
40-
# 数据卷
31+
TAPTAP_MCP_VERBOSE: "false"
4132
volumes:
42-
# Workspace 根目录(只读,用于读取用户代码)
43-
- ${WORKSPACE_ROOT:-/tmp/workspace}:/workspace:ro
44-
45-
# 缓存和临时文件(可写)
46-
- mcp-cache:/var/lib/taptap-mcp/cache
47-
- mcp-temp:/tmp/taptap-mcp/temp
48-
49-
# 健康检查
33+
# 持久化缓存(包含 OAuth token)
34+
- taptap-mcp-cache:/var/lib/taptap-mcp/cache
35+
# 临时文件(可选)
36+
- taptap-mcp-temp:/tmp/taptap-mcp/temp
5037
healthcheck:
5138
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
5239
interval: 30s
5340
timeout: 3s
54-
retries: 3
5541
start_period: 5s
56-
57-
# 日志配置
58-
logging:
59-
driver: "json-file"
60-
options:
61-
max-size: "10m"
62-
max-file: "3"
42+
retries: 3
6343

6444
volumes:
65-
mcp-cache:
66-
name: taptap-mcp-cache
67-
mcp-temp:
68-
name: taptap-mcp-temp
45+
taptap-mcp-cache:
46+
driver: local
47+
taptap-mcp-temp:
48+
driver: local

0 commit comments

Comments
 (0)