Dockerfile.cli 706 B

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