Docker base image and scaffolding stubs for ez-php modules and projects.
Central PHP runtime image published on Docker Hub. All ez-php modules use it as their base.
Includes:
- PHP 8.5 CLI
- Extensions:
pdo_mysql,mbstring,zip,intl,redis,pcov,xdebug - Composer 2
- Non-root user
sail(UID/GID 1000, configurable via build args) - Dev PHP config (
memory_limit = 512M,display_errors = On, xdebug coverage mode) - Default
container-start.sh: runscomposer installthensleep infinity
Build locally:
cd modules/docker
docker build -t au9500/php:8.5 .Build args:
| Arg | Default | Description |
|---|---|---|
WWWUSER |
1000 |
UID for the sail user |
WWWGROUP |
1000 |
GID for the sail group |
Scaffolds Docker setup for a new module or project by copying stub files into the project root.
composer require --dev ez-php/docker
vendor/bin/docker-initOr via Composer script (add to your project's composer.json):
"scripts": {
"docker:init": "php vendor/ez-php/docker/bin/docker-init"
}composer docker:init| Stub file | Purpose |
|---|---|
Dockerfile |
FROM au9500/php:8.5 — minimal module image |
docker-compose.yml |
App service only |
docker-compose.mysql.yml |
MySQL service addon (merge as needed) |
docker-compose.redis.yml |
Redis service addon (merge as needed) |
.env.example |
Env var template |
start.sh |
Convenience script: copies .env, starts compose, opens shell |
docker/db/create-db.sh |
MySQL init script: creates main + testing databases |
Existing files are never overwritten — safe to re-run after customisation.
The script reads the package name from composer.json and replaces all {{MODULE_NAME}} occurrences. For a package named ez-php/cache, it becomes cache, resulting in container names like ez-php-cache-app.
For a module that needs MySQL and Redis:
docker compose -f docker-compose.yml -f docker-compose.mysql.yml -f docker-compose.redis.yml up -dOr merge the relevant services manually into docker-compose.yml.
The generated Dockerfile is intentionally minimal:
FROM au9500/php:8.5
WORKDIR /var/www/htmlAll extensions, Composer, the sail user, and the default start script are baked into the base image. No COPY instructions needed for common infrastructure.