From 88c90f1447189ee767637471e764e72a9b2d05c4 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 29 Jan 2024 11:53:36 +0000 Subject: [PATCH] upd dockerfile --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 495bfb4..7a60dec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,14 @@ -FROM golang:alpine +FROM golang:1.21 -WORKDIR /dist +WORKDIR /usr/src/app -COPY . . - -# build binary and place into /usr/local/bin +# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change +COPY go.mod go.sum ./ RUN go mod download && go mod verify -RUN go build -v -o /usr/local/bin/q3rcon-proxy ./cmd/q3rcon-proxy + +# build binary and place into /usr/local/bin/ +COPY . . +RUN go build -v -o /usr/local/bin/q3rcon-proxy ./cmd/q3rcon-proxy/ # Command to run when starting the container ENTRYPOINT [ "q3rcon-proxy" ] \ No newline at end of file