Challenge 2: Explain the Size Reduction — Possible Solution ==================================================================== The builder stage's filesystem contains everything needed to PRODUCE the build output: the full source tree, dev-only dependencies (test frameworks, TypeScript's compiler, linters), any build tool caches, and the compiled output itself, all sitting alongside each other. Most of that is only relevant DURING the build process — once the compiled dist/ folder exists, the TypeScript compiler that produced it and the raw .ts source files it compiled from serve no further purpose for actually RUNNING the application. Copying the ENTIRE builder stage would carry all of that dead weight into the final image — every dev dependency, every source file, every build tool — none of which the running app ever touches, but all of which still consumes disk space and, more importantly, represents additional software (and therefore additional potential vulnerabilities) sitting in a production container for no functional benefit. Copying ONLY /app/dist (the compiled output) and the production node_modules (the packages actually required at runtime, not devDependencies used only during build/test) means the final image contains exactly what's needed to run the application and nothing else. This is precisely why the size difference is so large in practice — the excluded material (full source, dev tooling, build caches) is often the majority of what a typical single-stage image actually contains, even though none of it does anything once the app is running.