Laravel-ready PHP 8.4 FPM Alpine image with Nginx, Supervisor and Composer
6.6K
Production-ready Laravel container based on Alpine Linux.
This image provides a complete runtime environment for Laravel applications, bundling Nginx, PHP-FPM 8.4, Supervisor, Cron, Composer, and commonly used PHP extensions in a single lightweight container.
Ideal for VPS deployments, cloud instances, Docker Compose, and production environments.
php:8.4-fpm-alpineThe container automatically starts and manages:
| Service | Description |
|---|---|
| Nginx | HTTP Web Server |
| PHP-FPM | PHP FastCGI Process Manager |
| Supervisor | Process Manager |
| Cron | Executes Laravel Scheduler |
| Queue Workers | Processes Laravel Queues |
Supervisor monitors every service and automatically restarts any process that exits unexpectedly.
Includes:
Provides complete internationalization support for:
Perfect for multilingual Laravel applications.
/app
Your Laravel application should be mounted or copied into this directory.
/app
Example:
docker run \
-v $(pwd):/app \
netsas/laravel:latest
Default:
80
Configurable using:
NGINX_PORT=80
Build locally:
docker build --no-cache -t netsas/laravel:8.4-fpm-alpine .
Tag as latest:
docker tag netsas/laravel:8.4-fpm-alpine netsas/laravel:latest
Push to Docker Registry:
docker push netsas/laravel:8.4-fpm-alpine
docker push netsas/laravel:latest
docker run -d \
--name laravel \
-p 80:80 \
-v $(pwd):/app \
netsas/laravel:latest
Supervisor is the container's process manager.
It automatically starts and monitors:
If any service crashes, Supervisor automatically restarts it.
No manual process management is required.
Cron is preconfigured to execute the Laravel Scheduler every minute.
* * * * * cd /app && php artisan schedule:run >> /dev/null 2>&1
Simply define your scheduled tasks inside Laravel:
app/Console/Kernel.php
or (Laravel 11+)
routes/console.php
No additional cron configuration is necessary.
Supervisor automatically starts queue workers when the container boots.
Default configuration:
| Queue | Processes | Timeout | Memory |
|---|---|---|---|
| default | 2 | 120s | 512 MB |
| reports | 1 | 600s | 1024 MB |
Workers are configured to:
Example:
[program:queue-default]
command=php /app/artisan queue:work \
--queue=default \
--sleep=3 \
--tries=3 \
--timeout=120 \
--memory=512
[program:queue-reports]
command=php /app/artisan queue:work \
--queue=reports \
--sleep=3 \
--tries=2 \
--timeout=600 \
--memory=1024
The image includes the native phpredis extension.
Recommended Laravel configuration:
REDIS_CLIENT=phpredis
CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
Dispatch jobs normally:
ProcessOrder::dispatch();
GenerateReport::dispatch()->onQueue('reports');
After deploying new code, restart workers:
php artisan queue:restart
Supervisor automatically starts new worker processes after current jobs finish processing.
HTTP Request
│
▼
Nginx
│
▼
PHP-FPM
│
▼
Laravel Application
│
┌───────────┼───────────┐
▼ ▼ ▼
Redis Database Storage
│
▼
Queue Workers (Supervisor)
Cron
│
▼
Laravel Scheduler
phpredis.MIT License.
Content type
Image
Digest
sha256:c10c03fa8…
Size
77.3 MB
Last updated
4 months ago
docker pull netsas/laravel