Challenge 2: Add an Override File for Local Development — Possible Solution ==================================================================== # docker-compose.override.yml services: api: volumes: - .:/home/appuser/app environment: NODE_ENV: development WHY THIS WORKS AS AN ANSWER ------------------------------ docker-compose.override.yml is picked up AUTOMATICALLY by Compose whenever it sits alongside the base docker-compose.yml — no explicit -f flag needed for local development, exactly the override-file mechanism Chapter 3 introduced. The volumes entry adds a BIND MOUNT (Chapter 5) mapping the current host directory (.) into the exact path the api container's Dockerfile already uses as its working directory (/home/appuser/app, matching Step 1's WORKDIR) — so edits made on the host are immediately reflected inside the running container, enabling live-reload during development, without needing to rebuild the image for every source change. Crucially, this override file does NOT touch or duplicate anything from the base docker-compose.yml — it only ADDS the volumes and environment keys on top of the api service already defined there, exactly the additive-merge behavior Chapter 3 described for keys like environment (as opposed to keys like command, which would replace rather than merge). Running plain `docker compose up` locally automatically picks up this override; a production deployment that explicitly specifies only the base file (or a different override) never sees this local-only bind mount at all.