From c8570d07efe179b99567734b8ef1560f16bc2d50 Mon Sep 17 00:00:00 2001 From: Andrejs Baranovskis Date: Tue, 19 Nov 2024 17:31:42 +0100 Subject: [PATCH] Added debugging Dockerfile :sparkles: --- .gitignore | 1 + Dockerfile.debug | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Dockerfile.debug diff --git a/.gitignore b/.gitignore index f7e0f6c..6f7bcc0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /build /playground glance*.yml +/.idea \ No newline at end of file diff --git a/Dockerfile.debug b/Dockerfile.debug new file mode 100644 index 0000000..9ecff9d --- /dev/null +++ b/Dockerfile.debug @@ -0,0 +1,16 @@ +FROM golang:1.23.1-alpine3.20 AS builder + +WORKDIR /app +COPY . /app + +RUN go install github.com/go-delve/delve/cmd/dlv@latest +RUN CGO_ENABLED=0 go build -gcflags="all=-N -l" . + +FROM alpine:3.20 + +WORKDIR /app +COPY --from=builder /app/glance . +COPY --from=builder /go/bin/dlv . + +EXPOSE 2345/tcp 8080/tcp +CMD ["./dlv", "--listen=:2345", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "./glance"] \ No newline at end of file