From ff1cb1a9cf02e55a8a4aef3eabda27d1c68a6133 Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Sun, 23 Jun 2024 00:50:07 +0700 Subject: [PATCH] fix: dockerfile --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0b2e2f5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM golang:1.22.4-alpine3.20 as builder +WORKDIR /app + +COPY go.mod go.sum ./ + +RUN go mod download + +COPY . . + +RUN go build -o server ./cmd/main.go + + +FROM alpine AS runner +WORKDIR /app + +COPY --from=builder /app/server ./ + +ENV GO_ENV production + +EXPOSE 3000 + +CMD ["./server"] \ No newline at end of file