From 9b36316f738eb33da21a3cd8ea6df9fa60211a9f Mon Sep 17 00:00:00 2001 From: "MB.Kalpana" <70999645+MBkalpana@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:11:16 +0530 Subject: [PATCH] Create Dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..b8659c71c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM golang:1.21 as base + +WORKDIR /app + +COPY go.mod . + +RUN go mod download + +COPY . . + +RUN go build -o main . + +#Expose 8080 + +#CMD ["./main"] + + +#Final stage - Distroless Image + +FROM gcr.io/distroless/base + +#Binary +COPY --from=base /app/main . + +COPY --from=base /app/static ./static + +EXPOSE 8080 + +CMD ["./main"]