# Dockerfile for building the BOM Local Radar Card # This isolates Node.js/npm in a container for security FROM node:20-alpine WORKDIR /build # Copy the declared dependency set first for a reproducible cached build. COPY package.json package-lock.json ./ COPY tsconfig.json ./ COPY rollup.config.js ./ # Install the exact locked dependencies, including the build-only toolchain. RUN npm ci # Copy source files COPY src/ ./src/ # Default command: run the build # This ensures the build runs when the container starts, not during image creation # Use BUILD_TARGET to allow running "watch" or other scripts CMD ["sh", "-c", "npm run ${BUILD_TARGET:-build}"]