-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.dockerfile
More file actions
37 lines (26 loc) · 1.16 KB
/
debug.dockerfile
File metadata and controls
37 lines (26 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Dockerfile
FROM golang:1.24.4 AS builder
# allow this step access to build arg
ARG VERSION
# Set the working directory
WORKDIR /build
RUN go env -w GOMODCACHE=/root/.cache/go-build
RUN go install github.com/go-delve/delve/cmd/dlv@latest
# Install dependencies
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
COPY . ./
# Build the server
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -gcflags "all=-N -l" -ldflags="-X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o healenium-mcp-server cmd/main.go
# Final runtime image
FROM gcr.io/distroless/base-debian12
COPY --from=builder /build/healenium-mcp-server /app/server
COPY --from=builder /go/bin/dlv /usr/local/bin/dlv
WORKDIR /app
# Create directory for persistent UID storage
# The UID file will be created at /app/.healenium_uid
# To persist UID across container restarts, mount a volume at /app
# Expose debug port and default HTTP port
EXPOSE 52202 7878
ENTRYPOINT ["dlv", "exec", "/app/server", "--headless", "--listen=:52202", "--api-version=2", "--log", "--accept-multiclient"]