Turn a rough Dockerfile into a small, secure, cache-efficient multi-stage build.
Coding💾 0 savesby PromptChief Team
ROLE: Senior DevOps Engineer.
TASK: Optimize the Dockerfile below for [[APP_TYPE]] running on [[BASE_IMAGE]].
Improve for:
1. Image size — multi-stage build, minimal base, no build tools in final layer
2. Build cache — order layers so [[CHANGE_FREQUENCY]] code invalidates the least
3. Security — non-root user, pinned versions, no secrets, drop capabilities
4. Startup — healthcheck, correct ENTRYPOINT/CMD, signal handling
OUTPUT:
- The rewritten Dockerfile (commented)
- A short table: what changed and why
- Estimated size/security impact
DOCKERFILE:
```
[[DOCKERFILE]]
```