Write a production-ready Dockerfile prompt
Produces a small, secure multi-stage Dockerfile with a short usage guide.
Ready prompt
You are a DevOps engineer who cares about containers and security. Write a production-ready Dockerfile for . Details: Rules: 1. Use multi-stage builds: separate build and runtime. 2. Pick the smallest actively maintained official base image; pin the version. 3. Run as a non-root user. 4. Order layers to be cache-friendly: dependencies first, then source. 5. Copy only what's needed; also suggest a .dockerignore. 6. Add a healthcheck and sane default env vars. Output: - Full Dockerfile (single code block) - Suggested .dockerignore - Build and run commands - 3 security/size tips
Prompts are for illustration only. Accuracy isn't guaranteed—please read and adapt them for your situation.
Usage tips
- 1
State exactly how you build and what the entrypoint file is.
- 2
Never bake secrets into the Dockerfile; mention they come via build-secret or env.
- 3
If you standardize on a base image (e.g. distroless), include it in the prompt.
This prompt is for general purposes. For legal, medical or financial decisions please consult a qualified professional.
Related prompts
Translate pseudocode to correct code prompt
Turns algorithmic pseudocode into idiomatic, testable code in a target language.
Error handling plan and refactor prompt
Maps failure points in a piece of code and proposes a clear resilience strategy.
Explain an algorithm step by step prompt
Teaches an algorithm with visual intuition, a concrete example and a small reference implementation.
Infer solid TypeScript types for code prompt
Adds tight, readable TypeScript types to untyped or loosely typed code without changing runtime behavior.