Move GIN_MODE=release from build args to runtime environment variable

This commit is contained in:
2025-06-25 16:33:08 +03:30
parent 212637051f
commit 0c6160b756

View File

@@ -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"]