pomerium/Dockerfile.debug
backport-actions-token[bot] 3eaa60948c
docker: switch to debian (#3939)
docker: switch to debian (#3938)

Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
2023-02-03 13:16:02 -07:00

41 lines
1.2 KiB
Text

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.19.5-buster@sha256:150a98859da4c88935958d21d4fca1c74a139eac88e1eb2364c8f60d69236ede 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:640e07a7971e0c13eb14214421cf3d75407e0965b84430e08ec90c336537a2cf
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"]