Generate a Production-Ready Dockerfile and Explain Each Line
Generate a hardened, multi-stage Dockerfile with line-by-line comments and matching .dockerignore.
§ 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.
Best For — Roles
Use For — Tasks
§ Related Entries
You may also need
№ 025coding
Build and Explain a Regular Expression
Get a working regex with a plain-English breakdown and a set of passing/failing test cases.
For
claude·chatgpt
№ 012coding
Debug an Error Message Step-by-Step
Get a structured debugging plan: error explanation, ranked root causes, tests, and fixes.
For
claude·chatgpt
№ 097coding
Explain and Write a Regex From Plain English
Translate a plain-English matching requirement into a regex with line-by-line breakdown and edge cases.
For
claude·chatgpt
№ 002coding
Perform a Thorough Code Review on a Pull Request
Get a senior-engineer-style code review with categorized, file-referenced feedback.
For
claude·chatgpt