Add Dockerfile

This commit is contained in:
cpp 2020-11-17 08:29:35 +01:00
parent 1c554cedf0
commit 1f5cbcb12c

14
Dockerfile Normal file
View file

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