From 1f5cbcb12c6e152abb70fb03f2722676e718a238 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 17 Nov 2020 08:29:35 +0100 Subject: [PATCH] Add Dockerfile --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3bd1af6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.14 AS builder +WORKDIR /app +COPY . /app +RUN \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOPROXY=https://proxy.golang.org,direct \ + go build -ldflags "-s -w" -o main . + +FROM scratch +COPY --from=builder /app/main . +COPY phrases.json . +USER 1000 +ENTRYPOINT ["/main"]