# Build Chart.js from source using pnpm FROM node:18-bullseye WORKDIR /workspace # Install pnpm (v8 as required by the project) RUN npm install -g pnpm@8 # Install dependencies of the monorepo COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ # Use frozen lockfile to ensure reproducible builds RUN pnpm install --frozen-lockfile # Copy the full source code COPY . . # Build Chart.js from source RUN pnpm run build # Default to a shell so the container can be inspected or serve as a base image CMD ["/bin/bash"]
# Ignore node_modules and dist outputs, but keep package.json for install node_modules/ dist/ # Ignore local env files and VSCodium files .env *.log .vscode/ .idea/ # Ignore tests and docs outputs unless needed test/ docs/
Smoke [PASS]: node -v Smoke [PASS]: pnpm -v Smoke [PASS]: if [ -d dist ]; then echo dist_exists; else echo dist_missing; exit 1; fi