From 90a15cde204e6d2b06fe96fcdc018ec505cb6942 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 13 Sep 2026 02:45:16 +0200 Subject: [PATCH] The runtime keeps the compiler, because it is also the build environment Every module's recipe starts from this image and invokes the compiler out of it. Pruning build dependencies made a smaller image that nothing could be built on. --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a883368..b4f9f75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,10 +41,14 @@ RUN npm --prefix node_modules/@novox/mesh-sdk install --no-audit --no-fund \ COPY tsconfig.json ./ COPY src ./src RUN npm run build -# Dropped after compiling rather than reinstalled in the next stage, which would need git there too. -RUN npm prune --omit=dev -# Everything the modules compile against and run on, and nothing that only the build needed. +# Everything the modules compile against and run on. +# +# **The build dependencies stay, and that is deliberate.** This image is not only what a module runs +# in — it is also what every module is *compiled* in: a module's recipe starts from this and invokes +# the compiler out of these same directories. Dropping them would halve the image and break every +# module that builds on it, which is the sort of tidy-looking change that only fails somewhere else. +# If the two roles are ever separated, they should be separated deliberately and named separately. FROM node:22-bookworm-slim WORKDIR /app COPY package.json ./