Production is a compact and efficient Docker image for running your web project in production.
3.3K
Production is a lightweight, production-focused Docker image for running PHP applications with Nginx + PHP-FPM.
It provides a small, secure, non-root runtime designed for containerized production workloads, with dedicated images for both generic PHP applications and Laravel.
The complete source code, documentation, migration guides, tests, and release history are available on GitHub:
https://github.com/joaopinto14/Production
Issues and contributions should also be submitted through the GitHub repository.
linux/amd64linux/arm64/healthz endpointFor a PHP application with an index.php in its root directory:
docker run --rm \
-p 8080:8080 \
-v "$PWD:/var/www/html:ro" \
joaopinto14/production:2.0.0-php8.5
Open:
http://localhost:8080
The default document root for the Generic variant is:
/var/www/html
For a Laravel application with dependencies already installed:
docker run --rm \
-p 8080:8080 \
-v "$PWD:/var/www/html:ro" \
-v "$PWD/storage:/var/www/html/storage" \
-v "$PWD/bootstrap/cache:/var/www/html/bootstrap/cache" \
joaopinto14/production:2.0.0-laravel-php8.5
The Laravel variant automatically uses:
/var/www/html/public
as the document root.
Laravel writable directories such as storage and bootstrap/cache must be writable by the container runtime user.
| PHP | Versioned tag | Stable alias |
|---|---|---|
| PHP 8.3 | joaopinto14/production:2.0.0-php8.3 | joaopinto14/production:php8.3 |
| PHP 8.4 | joaopinto14/production:2.0.0-php8.4 | joaopinto14/production:php8.4 |
| PHP 8.5 | joaopinto14/production:2.0.0-php8.5 | joaopinto14/production:php8.5 |
The following aliases point to the Generic PHP 8.5 image:
joaopinto14/production:2.0.0
joaopinto14/production:latest
| PHP | Versioned tag | Stable alias |
|---|---|---|
| PHP 8.3 | joaopinto14/production:2.0.0-laravel-php8.3 | joaopinto14/production:laravel-php8.3 |
| PHP 8.4 | joaopinto14/production:2.0.0-laravel-php8.4 | joaopinto14/production:laravel-php8.4 |
| PHP 8.5 | joaopinto14/production:2.0.0-laravel-php8.5 | joaopinto14/production:laravel-php8.5 |
The following alias points to Laravel with PHP 8.5:
joaopinto14/production:laravel
For reproducible production deployments, versioned tags are recommended.
Example:
joaopinto14/production:2.0.0-laravel-php8.5
Production keeps the runtime architecture intentionally simple:
HTTP :8080
│
▼
Nginx
│
▼
PHP-FPM
│
▼
PHP application
The container uses a lightweight built-in process manager:
production-runtime
├── Nginx
└── PHP-FPM
It is responsible for:
Production does not use Supervisor, systemd or Python.
The same Laravel image can be used for web requests and CLI workloads.
When a custom command is supplied, Production executes it directly instead of starting Nginx and PHP-FPM.
docker run --rm \
-v "$PWD:/var/www/html" \
joaopinto14/production:2.0.0-laravel-php8.5 \
php artisan about
docker run --rm \
-v "$PWD:/var/www/html" \
joaopinto14/production:2.0.0-laravel-php8.5 \
php artisan migrate --force
docker run --rm \
-v "$PWD:/var/www/html" \
joaopinto14/production:2.0.0-laravel-php8.5 \
php artisan queue:work
docker run --rm \
-v "$PWD:/var/www/html" \
joaopinto14/production:2.0.0-laravel-php8.5 \
php artisan schedule:work
This allows the exact same image to be reused for:
Production supports runtime configuration through environment variables.
| Variable | Description |
|---|---|
TIMEZONE | Container/PHP timezone |
PHP_MEMORY_LIMIT | PHP memory limit |
UPLOAD_MAX_SIZE | Maximum HTTP/PHP upload size |
DOCUMENT_ROOT | Nginx document root |
Example:
docker run --rm \
-p 8080:8080 \
-e TIMEZONE=Europe/Lisbon \
-e PHP_MEMORY_LIMIT=512M \
-e UPLOAD_MAX_SIZE=100M \
-v "$PWD:/var/www/html:ro" \
joaopinto14/production:2.0.0-php8.5
services:
app:
image: joaopinto14/production:2.0.0-php8.5
ports:
- "8080:8080"
environment:
TIMEZONE: Europe/Lisbon
PHP_MEMORY_LIMIT: 256M
UPLOAD_MAX_SIZE: 50M
volumes:
- ./app:/var/www/html:ro
restart: unless-stopped
services:
app:
image: joaopinto14/production:2.0.0-laravel-php8.5
ports:
- "8080:8080"
environment:
TIMEZONE: Europe/Lisbon
PHP_MEMORY_LIMIT: 512M
UPLOAD_MAX_SIZE: 100M
volumes:
- ./:/var/www/html:ro
- ./storage:/var/www/html/storage
- ./bootstrap/cache:/var/www/html/bootstrap/cache
restart: unless-stopped
Production provides:
/healthz
Example:
curl http://localhost:8080/healthz
The Docker images also contain a built-in health check.
Nginx and PHP runtime logs are written to container stdout/stderr.
Use:
docker logs <container>
or:
docker logs -f <container>
No application log files need to be collected from inside the container for the web runtime.
Production 2.0 is designed to work with hardened container deployments.
The runtime:
no-new-privileges;chown application files when starting.Example hardened deployment:
services:
app:
image: joaopinto14/production:2.0.0-laravel-php8.5
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /run/production
- /tmp
Application-specific writable paths such as Laravel's storage and bootstrap/cache must still be provided with appropriate permissions.
The Laravel variant includes commonly required extensions for modern Laravel applications, including support for:
The Generic variant intentionally contains a smaller set of PHP extensions.
Production is a runtime image, not a development/build environment.
The runtime intentionally does not include tools such as:
Composer
Node.js
npm
Git
Python
Supervisor
build toolchains
Dependencies and application assets should be prepared during CI/CD or a multi-stage Docker build before the application is deployed.
Production images are published for:
linux/amd64
linux/arm64
Docker automatically selects the appropriate architecture when pulling an image.
Example:
docker pull joaopinto14/production:2.0.0-php8.5
This allows the same image tag to be used on x86-64 servers and ARM64 systems.
Production 2.0 contains several breaking changes compared with Production 1.1.3, including:
80 to 8080;INDEX_PATH was replaced by DOCUMENT_ROOT;MEMORY_LIMIT was replaced by PHP_MEMORY_LIMIT;Before upgrading an existing deployment, read the complete migration guide:
https://github.com/joaopinto14/Production/blob/main/MIGRATION.md
Full documentation is maintained in the GitHub repository:
Repository:
https://github.com/joaopinto14/Production
README:
https://github.com/joaopinto14/Production/blob/main/README.md
Migration guide:
https://github.com/joaopinto14/Production/blob/main/MIGRATION.md
Changelog:
https://github.com/joaopinto14/Production/blob/main/CHANGELOG.md
Release information:
https://github.com/joaopinto14/Production/blob/main/RELEASE.md
Bug reports, feature requests, and contributions are welcome through GitHub:
https://github.com/joaopinto14/Production/issues
Source code:
https://github.com/joaopinto14/Production
Production 2.0.0 provides a compact and hardened PHP runtime with:
Alpine Linux
+ Nginx
+ PHP-FPM
+ Production Runtime Manager
with dedicated Generic and Laravel images for PHP 8.3, 8.4 and 8.5 on AMD64 and ARM64.
Content type
Image
Digest
sha256:574e6480c…
Size
19.1 MB
Last updated
14 days ago
docker pull joaopinto14/production