Skip to content

Conversation

@yasu89
Copy link
Owner

@yasu89 yasu89 commented Jun 21, 2025

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 new docker-release job 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]

Copilot AI review requested due to automatic review settings June 21, 2025 18:36
Copy link
Contributor

Copilot AI left a 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/
Copy link

Copilot AI Jun 21, 2025

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.

Copilot uses AI. Check for mistakes.
{
"mcpServers": {
"switchbot": {
"command": "docker",
Copy link

Copilot AI Jun 21, 2025

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.

Copilot uses AI. Check for mistakes.
{
"mcpServers": {
"switchbot": {
"command": "docker",
Copy link

Copilot AI Jun 21, 2025

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

Code Metrics Report

main (b411668) #14 (b767bbf) +/-
Coverage 69.6% 69.6% 0.0%
Code to Test Ratio 1:1.7 1:1.7 0.0
Test Execution Time 27s 27s 0s
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

@yasu89 yasu89 merged commit bef9da7 into main Jun 21, 2025
2 checks passed
@yasu89 yasu89 deleted the feature/docker-hub branch June 21, 2025 18:37
@github-actions github-actions bot mentioned this pull request Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants