Code & Dev Compatible: claude

Multi-Stage Dockerfile and Local Compose Stack

Complexity Level: Beginner
Prompt Code Block

Write a local development stack and a production-shaped Docker build for this app. They are different files with different jobs. APP Language and framework: [NEXT.JS | ASTRO | FASTAPI | OTHER] Package manager: [PNPM | NPM | BUN | PIP] Services the app needs locally: [POSTGRES, REDIS, MAILPIT — edit] Port the app listens on: [PORT] Env vars required at boot: [LIST] Persistent data: [DB VOLUME | UPLOADS] Health: [PATH THAT RETURNS 200 WHEN READY] DELIVER 1) Dockerfile, multi-stage. deps → build → runtime. Pin the base image by major. Run as a non-root user in the final stage. Copy only the output needed to run. Include a note on where lockfile installs go so builds cache. 2) .dockerignore that actually changes the context size (git, node_modules, tests, local env files). 3) compose.yaml for local dev: app with a bind mount and a dev command (not the production server), database with a named volume and a healthcheck, and depends_on with the healthy condition. Mail catcher if I listed one. 4) A second compose profile or override note for running the production image locally, so we do not confuse "works in dev mount" with "the image boots." 5) Environment example file with comments, no real secrets, and a line that says which vars are public. 6) Commands: first boot, reset the database volume, and follow logs. 7) Three footguns for this framework in Docker (file watching on the mount, NEXT_PUBLIC_ baked at build, native addons) and which of them this setup addresses. Do not put secrets in the image. Do not use latest as the only tag.

🌟 Example Output / Preview

### Generated Component Preview: ```typescript // Fully validated modern structure import { z } from 'zod'; export const RequestSchema = z.object({ id: z.string().uuid(), createdAt: z.date().default(() => new Date()), data: z.record(z.string(), z.any()) }); export type ValidatedRequest = z.infer<typeof RequestSchema>; ```

Prompt Metadata

DifficultyBeginner
Compatibilityclaude

Primary Use Cases:

  • •Legacy code modernization & technical refactoring
  • •Full-stack layout generation & component structuring
  • •CI/CD workflow automation & unit/E2E testing suites

Associated Tags:

#docker #devops #postgres #local-dev

💡 Pro Tips & Advice

1. Use bracketed items: Be sure to fill out all [PLACEHOLDER] elements with specific details before sending the prompt to the AI model.

2. Adjust temperature: For creative tasks, set AI temperature higher (e.g., 0.8), or lower (e.g., 0.2) for strict coding/technical tasks.

🔗 Related AI Prompts

Code & Dev
★ Featured

Full SaaS Landing Page Build Spec (SEO + Conversion)

You are a Staff Product Designer + Frontend Engineer + SEO strategist. Build a complete, production-ready marketing landing page f...

Compatible:claudeDiff:Advanced
#landing-page #saas #seo #nextjs #tailwind
Code & Dev
★ Featured 🔥 Trending

SaaS Analytics Dashboard Full Build Spec

You are a Principal Product Designer + Frontend Lead. Design and specify a complete [LIGHT | DARK] analytics dashboard for [PRODUC...

Compatible:claudeDiff:Intermediate
#dashboard #saas #ui #tailwind #seo
Code & Dev

SaaS Admin Panel Dashboard Build Spec

Design a full internal Admin Dashboard for [PRODUCT_NAME] used by [ADMIN_ROLE: support | ops | super-admin]. --- 🎯 CONTEXT Adm...

Compatible:claudeDiff:Intermediate
#admin #dashboard #saas #crud #tailwind