From 6a850e76debed18680d9b21d72b6ba9fe55caad2 Mon Sep 17 00:00:00 2001 From: kandrusyak Date: Tue, 8 Aug 2023 21:59:48 +0300 Subject: [PATCH] debug variant --- Dockerfile | 14 ++++++++------ deploy/.env | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index ddd2eb1..7379244 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,7 @@ FROM kandrusyak/go-build as build LABEL authors="andrusyakka@dopcore.com" -WORKDIR /app - -ENV CGO_ENABLED 1 +WORKDIR / COPY go.mod ./ @@ -11,14 +9,18 @@ RUN go mod download COPY . ./ -RUN go build -o ./app +RUN CGO_ENABLED=0 go get -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv + +RUN CGO_ENABLED=0 go build -gcflags "all=-N -l" -o ./app FROM alpine:edge WORKDIR / -COPY --from=build /app /app +COPY . . +COPY --from=build /go/bin/dlv dlv +COPY --from=build /app app EXPOSE 8080 -CMD ["/app/app"] \ No newline at end of file +ENTRYPOINT [ "/dlv" , "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "/app"] \ No newline at end of file diff --git a/deploy/.env b/deploy/.env index 2f9f9ec..a4c934b 100644 --- a/deploy/.env +++ b/deploy/.env @@ -1,2 +1,2 @@ -SERVICE_REPLICAS=3 +SERVICE_REPLICAS=1 SERVICE_PORT=8080 \ No newline at end of file