Challenge 1: Add a .dockerignore — Possible Solution ==================================================================== node_modules .git .env *.log WHY THIS WORKS AS AN ANSWER ------------------------------ node_modules is excluded because it's reinstalled fresh inside the builder stage anyway (via npm install against package*.json) — sending a potentially large, host-specific node_modules folder as part of the build context wastes time and could even introduce platform-specific binaries that don't match the container's own OS/architecture. .git is excluded because the build never needs the full commit history or Git metadata to actually build the application — including it only bloats the build context unnecessarily. .env is excluded specifically to prevent a local file possibly holding real credentials from ever being accidentally COPYed into the image during the build — the exact security concern this chapter (and Chapter 6's broader credentials guidance) flagged directly, since anything present in the build context is a candidate for accidentally being copied into a layer. *.log excludes local log files, which have no purpose inside a built image and would just add unnecessary bulk to the build context sent to the Docker daemon.