FROM node:25@sha256:ccfc02deb6abb1b70b6ef21d3d93b3f671c0de6f463ff331cf0ea0a28ad875c9 AS typescript-builder RUN mkdir /app COPY hack/package*.json /app WORKDIR /app # this flattens the node_modules in a way similar to the global install (which we'll (ab)use in a second) RUN npm ci --install-strategy=shallow # /usr/bin/env is called from ts-proto but not in distroless by default; we use busybox for this FROM gcr.io/distroless/base-debian13:debug-nonroot@sha256:7f8dc86be3039dbc004c89848f906de44313c84026035348860abd5166622d3f AS env-source FROM gcr.io/distroless/nodejs24-debian13:nonroot@sha256:924918584d0e6793e578fc0e98b8b8026ae4ac2ccf2fea283bc54a7165441ccd # node is installed in a non-default location in distroless ENV PATH=$PATH:/nodejs/bin COPY --from=typescript-builder /app/node_modules /usr/local/lib/node_modules COPY --from=env-source /busybox/busybox /usr/bin/env COPY --from=protoc-base:typescript /protobuf/bin/protoc /usr/local/bin/ COPY --from=protoc-base:typescript /protobuf/include/google /opt/include/google COPY --from=protoc-base:typescript /googleapis /googleapis ENTRYPOINT ["/usr/local/bin/protoc", "--plugin=/usr/local/lib/node_modules/ts-proto/protoc-gen-ts_proto", "--ts_proto_opt=protoJsonFormat=false"]