From 0c6160b756de17428d59a4867d753ad89b4e7865 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Date: Wed, 25 Jun 2025 16:33:08 +0330 Subject: [PATCH] Move GIN_MODE=release from build args to runtime environment variable --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7c76d72..7fdc0e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN go mod download COPY cmd /app/cmd/ COPY internal /app/internal/ -RUN GIN_MODE=release CGO_ENABLED=1 GOOS=linux go build -o /CatsOfMastodonGo ./cmd/CatsOfMastodonBotGo/main.go +RUN CGO_ENABLED=1 GOOS=linux go build -o /CatsOfMastodonGo ./cmd/CatsOfMastodonBotGo/main.go # Deploy the application binary into a lean image FROM gcr.io/distroless/base-debian12 AS build-release-stage @@ -26,5 +26,6 @@ COPY --from=build-stage /app/internal/web/templates /internal/web/templates EXPOSE 8080 +ENV GIN_MODE=release ENTRYPOINT ["/CatsOfMastodonGo"] \ No newline at end of file