
- Prompt at a glance
- Category
- Text & chat
- Works with
- Claude · ChatGPT · Claude Code
- Length
- 78 words
- Fields to fill
- COMMANDS
- Last updated
Write a Dockerfile for your app
This prompt writes a Dockerfile for your app with a small base image, cached layers, a non-root user and a health check. It adds a docker-compose file for local development and keeps secrets out of the image.
Act as a DevOps engineer. App: [e.g. a FastAPI app with a requirements.txt] How it runs locally: [COMMANDS] Needs: [e.g. Postgres, Redis, env vars for API keys] Write a production-ready Dockerfile with a small base image, a multi-stage build if it helps, a non-root user, cached dependency layers and a health check. Add a docker-compose.yml for local development with the services it needs, and a .dockerignore. Explain each important line briefly, and keep secrets out of the image.
Check the image size with docker images. If it is over 1 GB, ask the AI to make it smaller.
From copy to answer in four steps
- 1
Open Claude and start a new chat.
- 2
Paste the prompt.
- 3
Replace each [BRACKETED] field with your real details and paste in your own text where asked.
- 4
Reply with follow-ups such as "make it shorter" or "make it sound more like me".
About this prompt
Which AI tools work with this prompt?
It is written for Claude, ChatGPT and Claude Code. Paste it into your preferred tool and adjust the wording if the result is off.
What do I need to fill in?
Replace the field before you send it: COMMANDS. Each field shows an example in the prompt.
Should I paste private information into the prompt?
Only what the task needs. Remove names, contact details and other sensitive data before pasting a resume or document into any AI tool.



