-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or request
Description
功能描述
提供开箱即用的 Docker 镜像和 Kubernetes 部署方案,简化 MCP 服务的生产环境部署。
Docker 部署
快速启动
# 使用官方镜像启动
docker run -d \
-p 8000:8000 \
-v ./tools:/app/tools \
-v ./config.yaml:/app/config.yaml \
-e OPENAI_API_KEY=sk-xxx \
lc2mcp/server:latest
# 或使用 docker-compose
docker-compose up -ddocker-compose.yml
version: '3.8'
services:
lc2mcp:
image: lc2mcp/server:latest
ports:
- "8000:8000"
volumes:
- ./tools:/app/tools
- ./config.yaml:/app/config.yaml
- ./data:/app/data
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- DATABASE_URL=postgresql://user:pass@db:5432/lc2mcp
depends_on:
- db
- redis
restart: unless-stopped
db:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=lc2mcp
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=lc2mcp
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
volumes:
postgres_data:
redis_data:Dockerfile
FROM python:3.11-slim
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# 安装 Python 依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 复制应用代码
COPY . .
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s \
CMD curl -f http://localhost:8000/health || exit 1
# 启动命令
EXPOSE 8000
CMD ["python", "-m", "lc2mcp_server"]Kubernetes 部署
Helm Chart
# 添加仓库
helm repo add lc2mcp https://charts.lc2mcp.dev
helm repo update
# 安装
helm install my-mcp lc2mcp/lc2mcp-server \
--set ingress.enabled=true \
--set ingress.host=mcp.example.com \
--set secrets.openaiApiKey=sk-xxxvalues.yaml
replicaCount: 3
image:
repository: lc2mcp/server
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 8000
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
host: mcp.example.com
tls:
enabled: true
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 200m
memory: 256Mi
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 80
persistence:
enabled: true
size: 10Gi
storageClass: gp3
postgresql:
enabled: true
auth:
database: lc2mcp
redis:
enabled: true
architecture: standalone云平台一键部署
| 平台 | 部署方式 | 状态 |
|---|---|---|
| Railway | 一键部署按钮 | 🔴 待实现 |
| Render | Blueprint | 🔴 待实现 |
| Fly.io | fly.toml | 🔴 待实现 |
| AWS ECS | CloudFormation | 🔴 待实现 |
| GCP Cloud Run | gcloud deploy | 🔴 待实现 |
任务清单
- 创建优化的 Dockerfile
- 创建 docker-compose 模板
- 开发 Helm Chart
- 添加健康检查端点
- 配置 CI/CD 镜像构建
- 发布到 Docker Hub
- 添加云平台部署模板
- 编写部署文档
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request