From 279500db508f7e2254442f7a5278965eb7cbe803 Mon Sep 17 00:00:00 2001 From: Blallo Date: Fri, 21 Feb 2020 18:17:20 +0100 Subject: [PATCH] Dockerfile added to build service image --- .dockerignore | 1 + Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..405ec2c --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +*.toml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..922f641 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM golang:1.13 AS builder + +WORKDIR /app +COPY go.mod go.sum /app/ +RUN go mod download +COPY *go /app/ +RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -tags netgo -o /sendmail ./... + + +FROM gcr.io/distroless/static + +ENV sm_server "" +ENV sm_port "465" +ENV sm_user "" +ENV sm_password "" +ENV sm_from "" +ENV sm_to "" +ENV sm_sub "" + +COPY --from=builder /sendmail / +WORKDIR / + +ENTRYPOINT ["/sendmail"]