Multi-aşamalı yapılar, bir Dockerfile içinde birden fazla FROM aşamasını kullanır — uygulamayı bir aşamada (tüm derleme araçlarıyla) derler ve final yapıtları temiz, minimal bir son aşamaya kopyalarlar. Bu, çok daha küçük, daha güvenli production imajları üretir.
Sorun: derleme araçları imajı şişirir
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.
