websnark/Dockerfile
Micah Zoltu 73700809f2 Adds esbuild & Dockerfile, skips a failing test.
* Adds esbuild as a bundler.
* Adds Dockerfile for deterministic building of the bundle.

Important Note:
The failing groth16 test fails on upstream, which means it is failing on the version used in Tornado Classic UI.
This is unfortunate, but if it is a critical bug at least it isn't an escalation compared to current state of things.
2024-12-21 20:21:07 +08:00

18 lines
545 B
Docker

FROM node:22.11.0-alpine3.20@sha256:b64ced2e7cd0a4816699fe308ce6e8a08ccba463c757c00c14cd372e3d2c763e
WORKDIR /workspace/
# cache dependencies
COPY ./package.json ./package-lock.json /workspace/
RUN npm ci --ignore-scripts
COPY index.js main.js /workspace/
COPY ./src/ /workspace/src/
COPY ./tools/ /workspace/tools/
COPY ./test/ /workspace/test/
COPY ./example/ /workspace/example/
RUN mkdir /workspace/build/
RUN npm run build
RUN node --test
RUN npx --no esbuild index.js --bundle --platform=browser --format=esm --outfile=build/bundle.mjs