| title | Example Applications |
|---|---|
| description | Production-ready Docker Compose setups for common PHP application patterns |
| weight | 1 |
Copy-paste ready Docker Compose configurations for common use cases.
All processes managed by Cbox Init - NO command overrides!
| Example | Use Case | Services |
|---|---|---|
| PHP Basic | Plain PHP without framework | PHP-FPM, Nginx |
| Laravel Basic | Simple Laravel app | PHP-FPM, Nginx, MySQL |
| Laravel Horizon | Queue dashboard | Horizon, Scheduler, MySQL, Redis |
| Laravel Production | Deploy ready | Resource limits, Horizon |
| Reverb WebSockets | Real-time features | Reverb, Queue, MySQL, Redis |
| Symfony Basic | Symfony app | Messenger, PostgreSQL |
| WordPress | CMS setup | PHP, MySQL |
| API Only | REST/GraphQL API | PHP, PostgreSQL, Redis |
| Development | Local dev | Xdebug, Vite HMR, MailHog |
| Multi-Tenant | SaaS | Central DB + Tenant DBs |
| Microservices | Distributed services | Gateway + Service containers |
| Static Assets | Pre-built frontend | PHP only, no Node runtime |
| Template | Description |
|---|---|
| Health Checks | Docker Compose override with built-in health checks for app/MySQL/Redis |
| GitHub Actions | Workflow file that pulls Cbox images, waits for health checks, and runs php artisan test |
- Copy the example folder to your project
- Adjust
docker-compose.ymlfor your needs - Run
docker compose up -d
# Example: Start Laravel basic setup
cp -r examples/laravel-basic/* ./
docker compose up -dAll examples use environment variables to control processes - NEVER override command: for PHP containers!
# Correct - Use environment variables
services:
app:
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.3-bookworm-v1
environment:
LARAVEL_QUEUE: "true" # Enables queue workers
LARAVEL_SCHEDULER: "true" # Enables scheduler
LARAVEL_HORIZON: "true" # Enables Horizon (replaces QUEUE)
LARAVEL_REVERB: "true" # Enables Reverb WebSocket server
# WRONG - Don't override command
services:
worker:
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.3-bookworm-v1
command: php artisan queue:work # DON'T DO THIS!Cbox images default to /var/www/html/public for frameworks like Laravel/Symfony.
For apps without public/ folder (WordPress, plain PHP), set WEBROOT:
services:
app:
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.3-bookworm-v1
environment:
WEBROOT: /var/www/html # Serve from root, not public/| App Type | WEBROOT Setting |
|---|---|
| Laravel, Symfony | Default (/var/www/html/public) |
| WordPress, plain PHP | WEBROOT: /var/www/html |
- Laravel:
laravel-basic,laravel-horizon,laravel-production,reverb-websockets - Symfony:
symfony-basic - WordPress:
wordpress - Plain PHP:
php-basic,api-only
- Development:
development(Xdebug, hot reload, exposed ports) - Production:
laravel-production(optimized, resource limits) - Testing: Use any with
APP_ENV=testing
- Monolith:
laravel-basic,symfony-basic - Queue-heavy:
laravel-horizon - Real-time:
reverb-websockets - Multi-tenant SaaS:
multi-tenant - Microservices:
microservices
volumes:
- ./:/var/www/html # Your code synced to containervolumes:
- app_storage:/var/www/html/storage
- app_cache:/var/www/html/bootstrap/cache
volumes:
app_storage:
app_cache:volumes:
- ./:/var/www/html # Code (bind mount)
- mysql_data:/var/lib/mysql # Database (named volume)services:
app:
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.3-bookworm-v1
environment:
LARAVEL_QUEUE: "true"
REDIS_HOST: redis
QUEUE_CONNECTION: redisservices:
app:
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.3-bookworm-v1
environment:
LARAVEL_HORIZON: "true" # Use instead of LARAVEL_QUEUE
REDIS_HOST: redisservices:
app:
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.3-bookworm-v1
environment:
LARAVEL_SCHEDULER: "true"services:
app:
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.3-bookworm-v1
ports:
- "8080:80"
- "8085:8085"
environment:
LARAVEL_REVERB: "true"
REVERB_HOST: 0.0.0.0
REVERB_PORT: 8085All examples use Cbox images. Swap versions as needed:
# Use different PHP version
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.5-bookworm-v1
# Use different tier
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.5-bookworm-slim-v1
image: ghcr.io/cboxdk/php-baseimages/php-fpm-nginx:8.5-bookworm-chromium-v1- Check the README in each example folder
- See documentation for detailed guides
- Open an issue on GitHub