Višefazne izgradnje koriste više FROM faza u jednoj Dockerfile — primjena se gradi u jednoj fazi (sa svim alatima za izgradnju) i samo se konačni artefakti kopiraju u čistu, minimalnu konačnu fazu. To proizvodi mnogo manje, sigurnije slike za proizvodnju.
Problem: alati za izgradnju otežavaju sliku
Building an app needs build tools (compilers, dev dependencies, SDKs), but the
FINAL image shouldn't include them:
→ they bloat the image (larger size, slower deploys)
→ they increase the attack surface (more software = more vulnerabilities)
→ You want only the built artifact + its runtime in the final image.
