hi everyone,
I am working on a web project (a developer Q&A platform) using Laravel, Next.js, and FrankenPHP. I want to implement a professional DevOps workflow and I’m looking for the most efficient way to organize my Docker setup for both Development and Production environments.
Specifically, I’m looking for advice on:
- Project Structure: Should I use a single
docker-compose.ymlwith overrides (docker-compose.override.yml) or separate files likedocker-compose.dev.ymlanddocker-compose.prod.yml? - Dockerfile Management: Is a multi-stage build the industry standard for handling both dev dependencies (like hot-reloading/debug tools) and production optimizations in a single Dockerfile?
- Environment Variables: How should I manage
.envfiles? Is it better to have separate.env.developmentand.env.productionfiles, or should I rely on the orchestrator (or CI/CD secrets) to inject them? - Best Practices: What is the most “clean” and maintainable way to handle common services (like DB, Redis) while changing only the web server configuration (e.g., FrankenPHP settings) between environments?
I’m aiming for a setup that is easy to manage via GitHub Actions for CI/CD.