FROM node:lts-bookworm@sha256:fd0115473b293460df5b217ea73ff216928f2b0bb7650c5e7aa56aae4c028426 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.21.5-bookworm@sha256:1415bb0b25d3bffc0a44dcf9851c20a9f8bbe558095221d931f2e4a4cc3596eb 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-debug NAME=pomerium RUN touch /config.yaml RUN go install github.com/go-delve/delve/cmd/dlv@latest FROM debian:bookworm@sha256:b16cef8cbcb20935c0f052e37fc3d38dc92bfec0bcfb894c328547f81e932d67 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 COPY --from=build /go/bin/dlv /bin COPY scripts/debug-entrypoint.sh / ENTRYPOINT [ "/bin/pomerium" ] CMD ["-config","/pomerium/config.yaml"]