A fully Dockerized Laravel development environment designed to help PHP developers level up their DevOps game and build modern, scalable Laravel apps — no more "It works on my machine" excuses. 💻
Perfect for freelancers, job seekers, or anyone tired of shared hosting that only works in Egypt. 😉
✅ Laravel – Latest and greatest
✅ Nginx + PHP-FPM – Production-grade web server setup
✅ MySQL – Persistent database with volume mounting
✅ Redis – For caching, queues, and real-time magic
✅ Queue Workers – Process jobs in the background
✅ Task Scheduling – schedule:work built-in
✅ HTTPS via mkcert – Secure local development with laraveldocker.test
✅ Composer & Artisan Containers – Run commands without local PHP
✅ NPM/Vite Integration – Frontend tooling with hot reload support
✅ PHPUnit Testing – Dedicated container for running tests
✅ Dedicated Services – Clean separation of concerns (no monoliths!)
✅ Works on macOS – No WSL2 freezes or file system lag
-
Clone the repo
git clone https://github.com/EslamKamel89/LaravelDockerized.git cd LaravelDockerized -
Build and start the stack
docker compose up --build -d
-
Install Laravel dependencies
docker compose run --rm composer install
-
Generate Laravel app key
docker compose run --rm artisan key:generate
-
Run migrations
docker compose run --rm artisan migrate
-
Visit your app
- HTTP: http://localhost
- HTTPS: https://laraveldocker.test (add to
/etc/hostsif needed)
| Task | Command |
|---|---|
| Run Artisan commands | docker compose run --rm artisan <command> |
| Run Composer | docker compose run --rm composer <command> |
| Run NPM/Vite | docker compose run --rm npm run dev |
| Run tests | docker compose run --rm phpunit |
| Start queue worker | docker compose up -d queue-worker |
| Start scheduler | docker compose up -d scheduler |
| View logs | docker compose logs -f |
To enable HTTPS:
- Install
mkcert:brew install mkcert mkcert -install
- Generate certs:
mkcert laraveldocker.test localhost 127.0.0.1 ::1
- Move certs to
nginx/certs/ - Rebuild:
docker compose up --build -d
- Jobs and scheduled tasks are fully supported.
- Queue worker and scheduler run as separate services.
- Redis handles everything in the background.
Found a bug? Want to add a feature? Pull requests are welcome!
If this project helped you, consider giving it a ⭐️ on GitHub!
Made with ❤️ by Eslam Kamel
For developers who want to charge more than $5 for a website. 💸