Dockerfile generator prompt for any stack

Generate a production-ready, multi-stage Dockerfile for your language and framework, including a non-root user setup.

بواسطة ‪Ahmed Eid‬‏Claude0 نسخة

متى تستخدم هذا البرومبت

  • When containerizing a project for the first time.
  • When your image is too large or slow to build.
  • When standardizing Dockerfiles across microservices.

نص البرومبت

Write a production-ready Dockerfile for a {{language}} app using {{framework}}. Use multi-stage builds where useful, minimize image size, and run as a non-root user. Notes: {{focus}}.

{{CLIPBOARD}}
{{language}}{{framework}}{{focus}}{{CLIPBOARD}}

الكتلة {{CLIPBOARD}} تُستبدل تلقائياً بما نسخته قبل الضغط على «نسخ».

كيف تستخدمه

  1. انسخ البرومبت بالزر أو املأ المتغيرات أولاً.
  2. الصقه في ChatGPT أو Claude أو Gemini.
  3. عدّل النتيجة أو أعد الطلب بتغيير المتغيرات.

مثال على النتيجة

FROM node:20-slim AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:20-slim
WORKDIR /app
RUN useradd -m appuser
COPY --from=build /app/dist ./dist
COPY --from=build /app/node_modules ./node_modules
USER appuser
CMD [\"node\", \"dist/index.js\"]

نصائح للاستخدام

  • Mention your package manager (npm, pip, poetry, cargo) so install steps match.
  • Ask for a .dockerignore file alongside the Dockerfile to keep the build context small.
  • If deploying to a specific platform (Cloud Run, ECS), mention it for port/env conventions.

النماذج الموصى بها

Claude

أسئلة شائعة

Will it include a .dockerignore file?
Ask for one explicitly; the default output focuses on the Dockerfile itself.
Does it handle environment variables and secrets?
It will reference ENV/ARG placeholders, but never paste real secret values into the prompt or the Dockerfile.

برومبتات ذات صلة

Generate a GraphQL Schema from a Description

Describe your data and operations in plain English and get a complete, documented GraphQL schema.

Design a GraphQL schema (types, queries, mutations) for: {{focus}}. Use {{language}} conventions and include field-level descriptions. {{CLIPBOARD}}

{{focus}}{{language}}{{CLIPBOARD}}

Generate Realistic Mock Data for Testing

Get realistic, varied mock data, including edge cases, matched to your schema, ready to seed a test database.

Generate {{focus}} realistic mock/test data records in {{language}} format for this schema or type, with varied and edge-case values. {{CLIPBOARD}}

{{focus}}{{language}}{{CLIPBOARD}}

Explain What This Legacy Code Actually Does

Paste unfamiliar or legacy code and get a plain-language walkthrough, with dead code and possible bugs flagged.

Walk through this {{language}} code line by line and explain what it does, in plain language. Flag anything that looks like dead code, a workaround, or a potential bug. {{CLIPBOARD}}

{{language}}{{CLIPBOARD}}

Write a Git Commit Message from a Diff

Paste a diff or change summary and get a clean, conventional commit message ready to use.

Write a concise, conventional-commits style git commit message for the following change. Focus: {{focus}}. Include a short body only if the change needs more context than the subject line. {{CLIPBOARD}}

{{focus}}{{CLIPBOARD}}
المزيد في برمجة