From ea3100df68002d1f418589e9151ca439618c25e5 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 2 Nov 2024 19:28:47 +0100 Subject: [PATCH] fixed Dockerfile --- Dockerfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index cbbe9b2..8d1a8d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,15 @@ -FROM golang:1.22.2 +FROM golang:1.22 -WORKDIR /usr/src/app +WORKDIR /app -# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change -COPY go.mod ./ -RUN go mod download && go mod verify +COPY go.mod ./ + +RUN go mod download COPY . . -RUN go build -v -o /usr/local/bin/humiditycalc ./... -CMD ["humiditycalc"] \ No newline at end of file +RUN go build -o /humiditycalc + +EXPOSE 8080 + +CMD [ "/humiditycalc" ] \ No newline at end of file