<feat> 添加 Docker 支持,包含 Dockerfile 和 .dockerignore 文件,更新 README 以说明 Docker 部署方法,更新依赖版本以支持 Python 3.12.3 及以上版本

This commit is contained in:
tangyi
2025-05-09 18:28:02 +08:00
parent d2965fd21c
commit e1f26abb99
5 changed files with 153 additions and 7 deletions

50
.github/workflows/docker-publish.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Docker Build and Publish
on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: docker.io
IMAGE_NAME: mangooer/mysql-mcp-server-sse
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=sha,format=short
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}