FROM node:lts-bookworm@sha256:5c76d05034644fa8ecc9c2aa84e0a83cd981d0ef13af5455b87b9adf5b216561 AS ui WORKDIR /build COPY .git ./.git COPY Makefile ./Makefile # download yarn dependencies COPY ui/yarn.lock ./ui/yarn.lock COPY ui/package.json ./ui/package.json RUN make yarn # build ui COPY ./ui/ ./ui/ RUN make build-ui FROM golang:1.23-bookworm@sha256:3f3b9daa3de608f3e869cd2ff8baf21555cf0fca9fd34251b8f340f9b7c30ec5 AS build WORKDIR /go/src/github.com/pomerium/pomerium RUN apt-get update \ && apt-get -y --no-install-recommends install zip # cache dependency downloads COPY go.mod go.sum ./ RUN go mod download COPY . . COPY --from=ui /build/ui/dist ./ui/dist # build RUN make build-go NAME=pomerium RUN touch /config.yaml FROM gcr.io/distroless/base-debian12:debug@sha256:a6b40812524ed4f6a2e507eb01ed04f867d9b4cb1e20369d62ffef0edd598efd ENV AUTOCERT_DIR=/data/autocert WORKDIR /pomerium COPY --from=build /go/src/github.com/pomerium/pomerium/bin/* /bin/ COPY --from=build /config.yaml /pomerium/config.yaml ENTRYPOINT [ "/bin/pomerium" ] CMD ["-config","/pomerium/config.yaml"]