From 1fb49b8df280ea4732888a98b62b281651c3a455 Mon Sep 17 00:00:00 2001 From: czoczo Date: Mon, 2 Jun 2025 22:59:25 +0200 Subject: [PATCH] Backend Dockerfile init --- webpage/backend/Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 webpage/backend/Dockerfile diff --git a/webpage/backend/Dockerfile b/webpage/backend/Dockerfile new file mode 100644 index 0000000..e0ea08b --- /dev/null +++ b/webpage/backend/Dockerfile @@ -0,0 +1,22 @@ +# Docker image definition + +FROM golang:1.22-bookworm as go-build + +WORKDIR /go/src/app + +COPY ./*go . + +RUN go mod init bbb && \ + go mod tidy && \ + CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o /bbb . + +# final image +FROM gcr.io/distroless/static-debian12:nonroot + +USER nonroot:nonroot + +WORKDIR /app + +COPY --chown=nonroot:nonroot --from=go-build /bbb /app/ + +ENTRYPOINT ["./bbb"]