mirror of
https://github.com/mangooer/mysql-mcp-server-sse.git
synced 2025-12-08 17:52:28 +08:00
<feat> 添加 Docker 支持,包含 Dockerfile 和 .dockerignore 文件,更新 README 以说明 Docker 部署方法,更新依赖版本以支持 Python 3.12.3 及以上版本
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
RUN apt-get update && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 复制本地代码到镜像
|
||||
COPY . .
|
||||
|
||||
# 自动生成 .env(如不存在则复制 example.env)
|
||||
RUN [ -f .env ] || cp example.env .env
|
||||
|
||||
# 安装依赖
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 暴露端口(如需)
|
||||
EXPOSE 3000
|
||||
|
||||
# 支持环境变量覆盖
|
||||
ENV HOST=0.0.0.0 \
|
||||
PORT=3000
|
||||
|
||||
CMD ["python", "-m", "src.server"]
|
||||
Reference in New Issue
Block a user