After 10 years of deploying Laravel applications, Iβve open-sourced the Docker stack Iβve been using in production.
The Problem
Every new Laravel project meant several hours of:
- Configuring Docker Compose
- Setting up Nginx and SSL certificates
- Server hardening (Fail2Ban, firewall, SSH)
- Writing deployment scripts
- Debugging permissions
It was never the interesting partβjust friction before actual work could begin.
The Solution: Dockavel
A production-ready Docker environment that handles everything with one command:
./scripts/deploy.sh prod
What It Does
π One-Command Deployment
- Development:
./scripts/dev.sh up - Production:
./scripts/deploy.sh prod - Zero-downtime deployments
π Automatic SSL
- Letβs Encrypt integration with auto-renewaβ¦
After 10 years of deploying Laravel applications, Iβve open-sourced the Docker stack Iβve been using in production.
The Problem
Every new Laravel project meant several hours of:
- Configuring Docker Compose
- Setting up Nginx and SSL certificates
- Server hardening (Fail2Ban, firewall, SSH)
- Writing deployment scripts
- Debugging permissions
It was never the interesting partβjust friction before actual work could begin.
The Solution: Dockavel
A production-ready Docker environment that handles everything with one command:
./scripts/deploy.sh prod
What It Does
π One-Command Deployment
- Development:
./scripts/dev.sh up - Production:
./scripts/deploy.sh prod - Zero-downtime deployments
π Automatic SSL
- Letβs Encrypt integration with auto-renewal
- Cloudflare origin certificates support
- Smart proxy detection
- HTTP to HTTPS redirects
π‘οΈ Security Hardening
Server setup script configures:
- Fail2Ban for SSH and HTTP protection
- UFW firewall with minimal ports
- SSH hardening (key-only, custom port)
- Automatic security updates
π¦ Full Production Stack
- Laravel 12+ with all optimizations
- PHP 8.4-FPM with all extensions
- MySQL 8.0 with persistent volumes
- Redis 7.0 for caching and sessions
- Laravel Horizon for queue monitoring
- Nginx as reverse proxy
πΎ Automated Backups
- Daily database backups
- Configurable retention (7/30/90 days)
- Email notifications
- One-command restoration
Quick Start
# Clone the repository
git clone https://github.com/mg2k4/Dockavel.git my-project
cd my-project
# Development
./scripts/deploy.sh dev
# Production (on your server)
./scripts/server-setup.sh # First time only
./scripts/deploy.sh prod
Your app is now running with SSL, security hardening, and automated backups!
What Makes It Different
Laravel Sail: Great for local development, not production-focused
Laradock: Offers many options but complex for production
Dockavel: Production-first, opinionated, one command to deploy
Architecture
βββββββββββββββ
β Nginx β β SSL termination, reverse proxy
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β PHP-FPM β β Laravel application
ββββββββ¬βββββββ
β
βββββ΄ββββ¬ββββββββββ
β β β
ββββΌβββ βββΌββββ ββββΌβββββ
βMySQLβ βRedisβ βHorizonβ
βββββββ βββββββ βββββββββ
Links
My First Open Source Project
This is my first time releasing something open source. Iβve been using variations of this stack for 5+ years in production, and I finally cleaned it up to share.
Feedback, issues, and PRs are very welcome! Let me know what features youβd like to see.
License
MIT - Free to use, modify, and distribute.
If this saves you even a few hours of Docker configuration, Iβll consider it a success. Happy deploying! π
What deployment challenges are you facing with Laravel? Let me know in the comments!