# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 FROM node:22.16-alpine3.22@sha256:41e4389f3d988d2ed55392df4db1420ad048ae53324a8e2b7c6d19508288107e as cli-build # Copy package.json & package-lock.json by themselves to create a cache layer COPY clients/js/package.json clients/js/package-lock.json /clients/js/ WORKDIR /clients/js RUN npm ci # Copy the rest of the source files, as a layer on top of the deps COPY clients/js /clients/js # Build CLI RUN npm run build FROM scratch AS cli-export COPY --from=cli-build clients/js/build/main.js clients/js/build/main.js COPY --from=cli-build clients/js/package.json clients/js/package.json