Goal
Run the app in containers with small images, no secrets baked in and one command to start local development.
Inputs
- Language, framework and version: [e.g. Node 20 with Next.js, Python 3.12 with Django]
- How the app is built and started now: [commands]
- Services it needs: [e.g. PostgreSQL 16, Redis, none]
- Environment variables it reads: [names only, no values]
- Port the app listens on: [port]
- Where it will run: [local only, a VPS, a cloud service]
Steps
- Write a multi-stage Dockerfile: build stage with dev dependencies, final stage with only what runs.
- Use a pinned official base image and run as a non-root user.
- Write a docker-compose file for local development with the services, volumes and a health check.
- Write a .dockerignore.
- Write a run guide with the commands to build, start, view logs and stop.
Output format
- Dockerfile in a code block, with a one-line comment above each stage.
- docker-compose.yml in a code block.
- .dockerignore in a code block.
- Run guide as numbered commands.
- A list of decisions you made and why, such as the base image.
Check before answering
- No secret values appear in any file; variables are read from an env file that is ignored by git.
- Dependency install comes before copying the source, so layers cache well.
- The final image does not contain build tools or test files.
- Every assumption about the app is stated, not hidden in the files.






