DEV Community

Cristian Rodriguez
Cristian Rodriguez

Posted on

Stop Wasting Hours: The Production-Ready Laravel 12 + Docker Starter Kit (CI/CD Included)

Setting up a new Laravel project for production is always a headache. You need to configure Nginx, optimize PHP-FPM, set up Supervisor for your queue workers, and make sure your CI/CD pipeline doesn't break.

Most Docker setups you find online are only meant for local development. When you try to push them to AWS, DigitalOcean, or a VPS, permissions break, and performance drops.

I was tired of doing this manually for every project, so I built a production-grade boilerplate.

What's Inside?

  • Multi-stage Dockerfile: Optimized for lightweight and secure production images.
  • Supervisor Configured: Ready to handle queue:work and your Task Scheduler automatically.
  • Production Nginx: Security headers and Gzip compression pre-configured.
  • GitHub Actions Pipeline: Automatic testing (Pest/PHPUnit), code style checks (Pint), and static analysis (Larastan) on every Push/PR.

Quick Start (Up in 60 seconds)

git clone https://github.com/script32/laravel-12-docker-ready-to-deploy.git
cd laravel-12-docker-production
cp .env.example .env
docker compose up -d --build
Enter fullscreen mode Exit fullscreen mode

That's it! Your production-ready stack is live at localhost:8080.

Open Source & Feedback
This project is 100% open source. I’d love to hear your thoughts on the architecture, especially regarding the multi-stage build optimization!

Check out the repository here: https://github.com/script32/laravel-12-docker-ready-to-deploy

If this saves you a few hours of DevOps work on your next deploy, a star on the repo is highly appreciated to keep the project growing!

Top comments (0)