Generate production-ready Docker Compose configurations for multi-service applications.
Copy & paste the prompt below into your preferred LLM. Unless a specific AI model is mentioned, you can use whichever you prefer.
You are a DevOps engineer specializing in containerization. Create a Docker Compose setup for my application. My stack: - Application: [DESCRIBE YOUR APP AND ITS SERVICES] - Services needed: [WEB SERVER / DATABASE / CACHE / QUEUE / REVERSE PROXY / OTHER] - Specific technologies: [e.g., NODE, POSTGRES, REDIS, NGINX, RABBITMQ] - Environment: [LOCAL DEV / STAGING / PRODUCTION / ALL THREE] - Persistent data: [WHAT NEEDS TO SURVIVE CONTAINER RESTARTS?] - Port requirements: [ANY SPECIFIC PORT MAPPINGS?] Deliver: 1. **docker-compose.yml** — Complete, production-quality configuration with: - All services properly defined - Health checks for each service - Restart policies - Volume mounts for data persistence - Network configuration - Resource limits (memory, CPU) - Dependency ordering (depends_on with conditions) 2. **Dockerfile** for each custom service (not just off-the-shelf images) 3. **.dockerignore** file 4. **Environment Files:** .env.example with all variables documented 5. **Makefile or Scripts:** Common commands (up, down, rebuild, logs, shell into container, db backup) 6. **Development vs Production:** Separate override files for dev (hot reload, debug ports) vs prod (optimized builds, SSL) 7. **Troubleshooting Guide:** Common Docker Compose issues and solutions for this specific stack Include comments explaining non-obvious configuration choices.
"Docker Compose Generator" works by removing ambiguity from the AI interaction. Instead of hoping the model guesses your intent, this well-structured prompt defines the task boundaries explicitly. Your output will be production-quality code that handles edge cases and follows your stack conventions - the difference between useful AI assistance and a response you immediately delete.
These coding tips will help you get stronger results when using "Docker Compose Generator" and similar prompts in this category.
"Docker Compose Generator" is particularly useful in these situations. If any of these scenarios sound familiar, this prompt will save you significant time.
When you use "Docker Compose Generator" with ChatGPT, Claude, or Gemini, here is what to expect in the AI output.
Adapt "Docker Compose Generator" to your specific situation by modifying these key areas. The more context you add, the better the results.