Dockerfile.cli 798 B

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