From c6157ef5b7b94b72f5aab2cfa35cbbd34393514a Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Fri, 2 Dec 2022 18:27:17 +0100 Subject: [PATCH] Dockerfile for running api in container --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1476360 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Build the project +FROM golang:1.19 as builder + +WORKDIR /go/src/github.com/kevinmidboe/planetposen-mail +ADD . . + +RUN make build +# RUN make test + +# Create production image for application with needed files +FROM golang:1.19-alpine + +EXPOSE 8000 + +RUN apk add --no-cache ca-certificates + +COPY --from=builder /go/src/github.com/kevinmidboe/planetposen-mail . + +CMD ["./main"] \ No newline at end of file