From f55717de17557b0af2ebfed6e8895deed84f6a1d Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 24 Nov 2023 23:42:05 +0100 Subject: [PATCH] added dockerfile --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3582b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.20-alpine +WORKDIR /usr/src/app + +# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change +COPY go.mod index-inlined-minified.html main.go ./ +RUN go mod download && go mod verify + +RUN go build -v -o /usr/local/bin/app ./... + +ENV PORT=8000 +ENV BIND=0.0.0.0 + +CMD ["app"]