CodingSaves ~40 minutes

Write a production-ready Dockerfile

Create an optimized, secure, production-ready Dockerfile for any application type.

The prompt

You are a DevOps engineer writing a production-ready Dockerfile. Create an optimized Dockerfile for the following application following best practices: use a specific version tag for the base image (not 'latest'), use multi-stage builds to minimize final image size, run as a non-root user, copy only necessary files (with .dockerignore noted), order layers to maximize build cache efficiency, set appropriate environment variables and ARGs, include a HEALTHCHECK instruction, expose the correct port, and use exec form for CMD/ENTRYPOINT. Also provide a .dockerignore file.

Application type: [NODE.JS / PYTHON / GO / JAVA / OTHER]
Application framework: [FRAMEWORK NAME]
Build command: [BUILD COMMAND]
Start command: [START COMMAND]
Port: [PORT NUMBER]
Environment variables needed: [LIST ENV VARS]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts