← IndexEntry № 096·coding

Generate a Production-Ready Dockerfile and Explain Each Line

Generate a hardened, multi-stage Dockerfile with line-by-line comments and matching .dockerignore.

Optimized for
ClaudeChatGPT
§ The Prompt— ready to copy
docker-build-explain.prompt
Write a production-grade Dockerfile for a [LANGUAGE/FRAMEWORK] application. Constraints: multi-stage build, non-root user, slim base image, layer caching for dependencies, no secrets in image. For each line, add a brief comment explaining WHY it's there. Also include a `.dockerignore` and a one-paragraph note on what runtime args to pass and why.

Replace anything in [BRACKETS] with your specifics before sending.

Use For — Tasks
Tags#docker#devops#deployment
§ Related Entries

You may also need