Build a Multi-Service Docker Compose Stack from a Description
Writing a docker-compose.yml for a multi-service setup involves a lot of boilerplate — volumes, networks, healthchecks, env vars, dependency ordering. Describe what you need and Claude will wire it all up.
Write a docker-compose.yml for a Laravel app with:
- PHP-FPM 8.3 app container
- Nginx web server
- PostgreSQL 16 with a named volume for data persistence
- Redis for queues and sessions
- A queue worker container running the same image as the app
- All services on a shared internal network
- An .env file for credentials
Claude will produce a complete compose file with proper depends_on health checks, named volumes, and a sensible network layout — not just a skeleton you have to fill in yourself.
You can also ask it to add common extras:
Add a Mailpit container for local email testing and expose it on port 8025.
Also add a schedule container running `artisan schedule:work`.
Or ask Claude to review an existing compose file for issues:
Here's my current docker-compose.yml. What's wrong with it and how would you
improve the healthchecks, volume mounts, and startup order?
A compose file you didn't have to write from scratch is one that actually gets committed to the repo.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.