From f2e90ae1d6d59a1395bc3a48175553a9f244a023 Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Thu, 7 Mar 2024 16:08:02 +0700 Subject: [PATCH] feat: update Dockerfile --- build/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/Dockerfile b/build/Dockerfile index b725266..e095a62 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,9 +1,15 @@ FROM golang:alpine as builder WORKDIR /app + COPY go.* ./ + +RUN go get -v ./... RUN go mod download +RUN go mod vendor + COPY . . + RUN apk update && apk add upx ca-certificates openssl && update-ca-certificates RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o /bin/api-binary ./main.go RUN upx -9 /bin/api-binary