FROM node:16@sha256:68e34cfcd8276ad531b12b3454af5c24cd028752dfccacce4e19efef6f7cdbe0 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.20.2-buster@sha256:57dbdd5c8fe24e357b15a4ed045b0b1607a99a1465b5101304ea39e11547be27 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:latest@sha256:c1c4bb9bb5914a9a220a9d130966922b177ab552efdc019d7372936c32cc1e2e 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"]