Spaces:
Build error
Build error
| # Multi-stage build for GitHub MCP Server | |
| FROM golang:1.24.4-alpine AS builder | |
| WORKDIR /build | |
| # Install git for go mod download | |
| RUN apk add --no-cache git | |
| # Copy go mod files first for better caching | |
| COPY go.mod go.sum . | |
| # Download dependencies | |
| RUN go mod download | |
| # Copy source code | |
| COPY . . | |
| # Build the Go binary | |
| RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o github-mcp-server ./cmd/github-mcp-server | |
| # Final stage | |
| FROM alpine:latest | |
| RUN apk --no-cache add ca-certificates | |
| WORKDIR /root/ | |
| # Copy the binary from builder stage | |
| COPY --from=builder /build/github-mcp-server . | |
| # Copy the Python proxy script | |
| COPY app.py . | |
| # Make sure the binary is executable | |
| RUN chmod +x github-mcp-server | |
| # Expose port | |
| EXPOSE 8080 | |
| # Run the Python proxy | |
| CMD ["python3", "app.py"] | |