From 120695c0a5729180aa18f51287ec84d144c8397f Mon Sep 17 00:00:00 2001 From: sHa Date: Fri, 20 Mar 2026 14:24:02 +0200 Subject: [PATCH] Remove Containerfile and update Docker Compose configuration; add GitHub Actions workflow for automated image build and push --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++++++++++ Containerfile | 22 -------------------- README.md | 2 ++ compose.yml | 4 +--- 4 files changed, 44 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 Containerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7867e29 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build and push image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: build/Containerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/${{ github.repository }}:latest + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Containerfile b/Containerfile deleted file mode 100644 index 02aaca4..0000000 --- a/Containerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM python:3.12-slim - -WORKDIR /app - -# Install uv -COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv - -# Copy dependency files first for layer caching -COPY pyproject.toml uv.lock* ./ - -# Install deps into system python (no venv needed in container) -RUN uv pip install --system mcp httpx - -COPY server.py . - -ENV MCP_TRANSPORT=http -ENV MCP_HOST=0.0.0.0 -ENV MCP_PORT=8000 - -EXPOSE 8000 - -CMD ["python", "server.py"] diff --git a/README.md b/README.md index 2e580a3..dcec8fa 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ REDMINE_API_KEY=your_personal_api_key_here ### 3. Run the container +The image is published automatically to `ghcr.io/shadoll/redmine-mcp:latest` on every push to `main`. + ```bash docker compose up -d # or with podman: diff --git a/compose.yml b/compose.yml index 74a1e9c..3ef922e 100644 --- a/compose.yml +++ b/compose.yml @@ -1,8 +1,6 @@ services: redmine-mcp: - build: - context: . - dockerfile: Containerfile + image: ghcr.io/shadoll/redmine-mcp:latest ports: - "8765:8000" environment: