-
Notifications
You must be signed in to change notification settings - Fork 1
Support Docker Image #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Docker support for the SwitchBot MCP Server by introducing a multi-stage Dockerfile, updating the GitHub Actions workflow to build and push Docker images, and revising both English and Japanese README files with improved usage instructions.
- Added a multi-stage Dockerfile for building and packaging the application.
- Updated GitHub Actions workflow (tagpr.yml) to include a docker-release job for multi-platform Docker image builds and publication.
- Revised README and README_ja files to recommend Docker usage and moved binary instructions into a collapsible section.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Updated installation instructions to include a Docker usage section |
| README_ja.md | Updated Japanese documentation mirroring the Docker instructions in README |
| Dockerfile | Added a multi-stage Dockerfile for building and running the application |
| .github/workflows/tagpr.yml | Introduced a new docker-release job for building, pushing, and attesting Docker images |
| @@ -0,0 +1,10 @@ | |||
| FROM golang:1.24.4-alpine3.22 AS builder | |||
| WORKDIR /workspace | |||
| COPY . /workspace/ | |||
Copilot
AI
Jun 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a .dockerignore file to exclude unnecessary files from the build context, which can improve build performance and reduce the final image size.
| { | ||
| "mcpServers": { | ||
| "switchbot": { | ||
| "command": "docker", |
Copilot
AI
Jun 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a specific version tag instead of "latest" for the Docker image to ensure reproducible deployments in production.
| { | ||
| "mcpServers": { | ||
| "switchbot": { | ||
| "command": "docker", |
Copilot
AI
Jun 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a specific version tag instead of "latest" for the Docker image to ensure reproducible deployments in production.
Code Metrics Report
Details | | main (b411668) | #14 (b767bbf) | +/- |
|---------------------|----------------|---------------|------|
| Coverage | 69.6% | 69.6% | 0.0% |
| Files | 3 | 3 | 0 |
| Lines | 99 | 99 | 0 |
| Covered | 69 | 69 | 0 |
| Code to Test Ratio | 1:1.7 | 1:1.7 | 0.0 |
| Code | 206 | 206 | 0 |
| Test | 353 | 353 | 0 |
| Test Execution Time | 27s | 27s | 0s |Reported by octocov |
This pull request introduces Docker support for the SwitchBot MCP Server, updates the workflow to include Docker image creation and publication, and revises the documentation to reflect these changes. The most significant updates include adding a Dockerfile, modifying the GitHub Actions workflow to build and push Docker images, and enhancing the README files with instructions for using Docker.
Docker support:
Dockerfile: Added a multi-stage Dockerfile to build and package the SwitchBot MCP Server application. The first stage compiles the Go binary, and the second stage creates a lightweight runtime image.GitHub Actions workflow updates:
.github/workflows/tagpr.yml: Added a newdocker-releasejob to build and push Docker images to Docker Hub. This includes setting up QEMU and Buildx for multi-platform builds, logging into Docker Hub, and generating an artifact attestation.Documentation updates:
README.md: Updated installation instructions to recommend using Docker for running the server, including a sample configuration for Claude Desktop. Binary usage instructions were moved into a collapsible section for clarity. [1] [2]README_ja.md: Updated Japanese documentation to mirror the changes in the English README, recommending Docker usage and reorganizing binary instructions into a collapsible section. [1] [2]