Dockerfile added to build service image

This commit is contained in:
Blallo 2020-02-21 18:17:20 +01:00
parent dc8f9ec86a
commit 279500db50
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F
2 changed files with 24 additions and 0 deletions

1
.dockerignore Normal file
View file

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

23
Dockerfile Normal file
View file

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