FROM node:22-bullseye-slim AS build
WORKDIR /isolated-vm
RUN apt-get update && \
  apt-get install -y --no-install-recommends \
  g++ \
  make \
  python3
COPY . .
RUN npm install --ignore-scripts
RUN MAKEFLAGS=-j$(nproc) npx -y prebuild
FROM scratch
COPY --from=build /isolated-vm/prebuilds .
