Skip to content

Commit bbc9aee

Browse files
committed
initial
0 parents  commit bbc9aee

File tree

11 files changed

+1694
-0
lines changed

11 files changed

+1694
-0
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
kuadrant-mcp-server
2+
*.exe
3+
*.test
4+
*.out
5+
.git
6+
.gitignore
7+
README.md
8+
Dockerfile
9+
docker-compose.yml
10+
.dockerignore

.github/workflows/docker.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Docker Build and Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Log in to the Container registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Extract metadata
39+
id: meta
40+
uses: docker/metadata-action@v5
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
tags: |
44+
type=ref,event=branch
45+
type=ref,event=pr
46+
type=semver,pattern={{version}}
47+
type=semver,pattern={{major}}.{{minor}}
48+
type=sha
49+
50+
- name: Build and push Docker image
51+
uses: docker/build-push-action@v5
52+
with:
53+
context: .
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# Go workspace file
18+
go.work
19+
go.work.sum
20+
21+
# Environment files
22+
.env
23+
.env.local
24+
25+
# IDE files
26+
.vscode/
27+
.idea/
28+
*.swp
29+
*.swo
30+
*~
31+
32+
# OS files
33+
.DS_Store
34+
Thumbs.db
35+
36+
# Build output
37+
/kuadrant-mcp-server
38+
/dist/
39+
/build/

Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Build stage
2+
FROM golang:1.23-alpine AS builder
3+
4+
# Install necessary packages
5+
RUN apk add --no-cache git
6+
7+
# Set working directory
8+
WORKDIR /app
9+
10+
# Copy go mod files
11+
COPY go.mod go.sum ./
12+
13+
# Download dependencies
14+
RUN go mod download
15+
16+
# Copy source code
17+
COPY *.go ./
18+
19+
# Build the binary
20+
RUN CGO_ENABLED=0 GOOS=linux go build -o kuadrant-mcp-server .
21+
22+
# Final stage
23+
FROM alpine:latest
24+
25+
# Install ca-certificates for HTTPS
26+
RUN apk --no-cache add ca-certificates
27+
28+
# Create non-root user
29+
RUN addgroup -g 1001 -S mcp && \
30+
adduser -u 1001 -S mcp -G mcp
31+
32+
# Set working directory
33+
WORKDIR /app
34+
35+
# Copy binary from builder
36+
COPY --from=builder /app/kuadrant-mcp-server .
37+
38+
# Change ownership
39+
RUN chown -R mcp:mcp /app
40+
41+
# Switch to non-root user
42+
USER mcp
43+
44+
# The MCP server uses stdio for communication
45+
ENTRYPOINT ["./kuadrant-mcp-server"]

0 commit comments

Comments
 (0)