# ============LICENSE_END=================================================
#
-FROM golang:1.19-bullseye AS build
+FROM golang:1.20.3-buster AS build
+
WORKDIR /app
-COPY go.mod .
-COPY go.sum .
-RUN go mod download
+
COPY main.go .
+RUN go mod init main
+RUN go mod tidy
+
RUN go build -o /pm-rapp
-#Replaced distroless image with ubuntu for debug purposes (seem to be cert problems with distroless image...?)
FROM gcr.io/distroless/base-debian11
-#FROM ubuntu
+
WORKDIR /
## Copy from "build" stage
COPY --from=build /pm-rapp .
-##Uncomment this when using distroless image
-USER nonroot:nonroot
ENTRYPOINT ["/pm-rapp"]