Browse Source

Dockerfile added to build service image

Blallo 4 years ago
parent
commit
279500db50
2 changed files with 24 additions and 0 deletions
  1. 1 0
      .dockerignore
  2. 23 0
      Dockerfile

+ 1 - 0
.dockerignore

@@ -0,0 +1 @@
+*.toml

+ 23 - 0
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"]