From f6beda9047af7fe68232854b98bacbbe42170faa Mon Sep 17 00:00:00 2001 From: dezeroku Date: Sun, 29 Sep 2024 04:37:15 +0200 Subject: [PATCH] dockerfile: init --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..39105ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM golang:1.23 AS build + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY *.go ./ + +RUN CGO_ENABLED=0 GOOS=linux go build + +FROM build-stage AS test +RUN go test -v ./... + +FROM gcr.io/distroless/static-debian12 AS release + +WORKDIR / + +COPY --from=build /app/ses_local_email /ses_local_email + +USER nonroot:nonroot + +ENTRYPOINT ["/ses_local_email"]