Docker PHP 5.3-8.3 and NodeJS 18/20/22 images dedicated to development
100K+
The images are built and published on Docker Hub.
All images are also available on Smile Registry You can replace "virtuasa/" by "registry.smile.fr/smile-suisse/" to use Smile registry
Base Images
virtuasa/php-dev:bookworm-sury debian image with toolsPHP Images virtuasa/php-dev:${PHP_VERSION}-${TYPE}-bookworm-sury PHP_VERSION=(5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4)
virtuasa/php-dev:${PHP_VERSION}-cli-bookworm-suryvirtuasa/php-dev:8.3-cli-bookworm-suryvirtuasa/php-dev:${PHP_VERSION}-fpm-bookworm-suryvirtuasa/php-dev:8.3-fpm-bookworm-suryvirtuasa/php-dev:${PHP_VERSION}-nginx-bookworm-suryvirtuasa/php-dev:8.3-nginx-bookworm-suryvirtuasa/php-dev:${PHP_VERSION}-apache-bookworm-suryvirtuasa/php-dev:8.3-apache-bookworm-suryPHP with NodeJS virtuasa/php-dev:${PHP_VERSION}-${TYPE}-node-${NODE_VERSION}-bookworm-sury NODE_VERSION=(18 20 22)
virtuasa/php-dev:${PHP_VERSION}-cli-node-${NODE_VERSION}-bookworm-suryvirtuasa/php-dev:8.3-cli-node-22-bookworm-suryvirtuasa/php-dev:${PHP_VERSION}-fpm-node-${NODE_VERSION}-bookworm-suryvirtuasa/php-dev:8.3-fpm-node-22-bookworm-suryvirtuasa/php-dev:${PHP_VERSION}-nginx-node-${NODE_VERSION}-bookworm-suryvirtuasa/php-dev:8.3-nginx-node-22-bookworm-suryvirtuasa/php-dev:${PHP_VERSION}-apache-node-${NODE_VERSION}-bookworm-suryvirtuasa/php-dev:8.3-apache-node-22-bookworm-suryUse make help to see the build targets.
Examples:
make all build all imagesmake all-php build all php imagesmake base php-8.3 php-8.3-node-18 build php 8.1 imagesTags (virtuasa/php-dev:) | 5.6 | 7.0 | 7.1 | 7.2 | 7.3 | 7.4 | 8.0 | 8.1 | 8.2 | 8.3 | 8.4 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| PHP | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| XDebug) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
composer | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
local-php-security-checker | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
phive | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||||
| Apache | apache | apache | apache | apache | apache | apache | apache | apache | apache | apache | apache |
| NGINX | nginx | nginx | nginx | nginx | nginx | nginx | nginx | nginx | nginx | nginx | nginx |
| MSMTP | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
NodeJs (node npm) | node | node | node | node | node | node | node | node | node | node | node |
Yarn (yarn) | node | node | node | node | node | node | node | node | node | node | node |
| Debian | bookworm | bookworm | bookworm | bookworm | bookworm | bookworm | bookworm | bookworm | bookworm | bookworm | bookworm |
To customize this setup on your projects, changes must only be done to file docker compose.yml.
Apache calls PHP with mod_php. Nginx calls PHP with php-fpm
These variable are used on runtime and can change the default behavior of the images. Their value can be changed in
docker compose.ymlfile.
| Variable name | Default value | Description |
|---|---|---|
HOSTNAME_LOCAL_ALIAS | `` | List of hosts names alias for machine resolved to 127.0.0.1, separator is coma |
FIXUID | 1000 | docker user UID (see id -u in you host) must be set to UID of the developer *** |
FIXGID | 1000 | docker user GID (see id -g in you host) must be set to GID of the developer *** |
DOCKER_TIMEZONE | Europe/Zurich | Time zone of the Docker container |
LANG | C.UTF-8 | System locale |
SMTP_MAILHUB | smtp.docker:25 | The host to send mail to, in the form host IP_addr[:port]. The default port is 25. |
SMTP_AUTH_USER | (empty) | The user name to use for SMTP AUTH. The default is blank, in which case SMTP AUTH is not used. sent without |
SMTP_AUTH_PASS | (empty) | The password to use for SMTP AUTH. |
SMTP_SENDER_HOSTNAME | (empty) | The full qualified name of the host. If not specified, the host is queried for its hostname. |
DOCKER_CUSTOM_INIT | (empty) | Execute script before doing anything else only on container creation * |
DOCKER_COPY_DIR_TO_ETC | (empty) | Copy directory content to /etc and all process files *.j2 with Jinja2 (all env variables are available) and extension .j2 removed * |
DOCKER_COPY_DIR_TO_BIN | (empty) | Copy directory content to /user/local/bin * |
DOCKER_MKDIR | (empty) | Create requested directories using mkdir -p if set * |
| Variable name | Default value | Description |
|---|---|---|
WRITABLE_PATH | var | The list of folder writable by apache or nginx (folder separated by space) |
VAR_DIR | var | Directory to store applications (php, xdebug, apache, php-fpm, nginx) logs |
XDEBUG_MAIN_HOST | localhost | XDEBUG main host to debug on cli |
XDEBUG_DISABLE | (empty) or yes | XDEBUG disabled on image start, XDEBUG_DISABLE=yes |
XDEBUG_CLIENT_HOST | (empty) | XDEBUG client host to debug on cli recommended value host.docker.internal |
MOUNT_DIR | /data | Docker mount path inside the container ** |
PHP_MEMORY_LIMIT | 512M | Maximum amount of memory a PHP script running may consume |
ACL_ENABLE | (empty) or yes | Execute setfacl on container start |
| Variable name | Default value | Description |
|---|---|---|
DOCUMENT_ROOT | public | Path to the Apache document root folder if empty direct project root * |
SERVER_NAMES | `` (empty) or domain1.docker,domain2.docker | First domain used as ServerName and the others as ServerAlias, if empty catch all |
SSL_CERT_KEY | /etc/ssl/private/ssl-cert-snakeoil.key | Private key used by Apache for SSL ** |
SSL_CERT_PEM | /etc/ssl/certs/ssl-cert-snakeoil.pem | Public certificate used by Apache for SSL ** |
SSL_CERT_CA | `` | Optional Server Certificate Chain, PEM encoded CA certificates, used by Apache for SSL ** |
SSL_FORCE | `` (empty) or yes | Force http redirect to https |
| Variable name | Default value | Description |
|---|---|---|
DOCUMENT_ROOT | public | Path to the Apache document root folder if empty direct project root * |
SERVER_NAMES | `` (empty) or domain1.docker,domain2.docker | Domains used as server_name, if empty catch all |
SSL_CERT_KEY | /etc/ssl/private/ssl-cert-snakeoil.key | Private key used by NGNIX for SSL ** |
SSL_CERT_PEM | /etc/ssl/certs/ssl-cert-snakeoil.pem | Public certificate and Certificate Chain used by NGNIX for SSL ** |
SSL_FORCE | `` (empty) or yes | Force http redirect to https |
* Path is relative to the Docker container mount path, i.e., to the root of the project.
** Path is absolute in the Docker container, don't forget to add the path /data of the mount path if needed.
*** FIXUID and FIXGID must be set globally host side.
If you host linux user don't have the id 1000 (check with id), please set the globals variables to your session :
printf "FIXUID=`id -u`\nFIXGID=`id -g`" >> ~/.profile
When using docker compose file, set user parameter for the container like that :
user: ${FIXUID:-1000}:${FIXGID:-1000}
List of extra command line tools, not exhaustive :
| Command | Description |
|---|---|
xdebug-disable | XDebug Disable completely on the container, for performance purpose (http and cli) |
xdebug-disable-autostart | XDebug Disable auto start on each HTTP call |
xdebug-enable | XDebug Enable completely on the container, for debug purpose (http and cli) |
xdebug-enable-autostart | XDebug Enable auto start on each HTTP call |
php-xdebug <php script and params> | Run a PHP CLI command with XDebug active |
php-no-xdebug <php script and params> | Run a PHP CLI command without extension XDebug |
php-profile <php script and params> | Run a PHP CLI command with profiling, profiling file generated |
docker-php-ext-disable ext-name [ext-name ...] | Disable PHP extension |
docker-php-ext-enable ext-name [ext-name ...] | Enable PHP extension |
docker-php-ext-install ext-name [ext-name ...] | Install PHP extension |
local-php-security-checker | Local PHP Security Checker |
composer | Composer Dependency Manager for PHP |
These variables are used to build the images and can be used to adapt behaviors between their different flavors. Changing their value is not recommended.
| Variable name | Sample value | Description |
|---|---|---|
DOCKER_BUILD_DATE | 2017-12-13T15:22:29+0100 | Build date of the image, using ISO-8601 format |
DOCKER_FROM_COMMIT | f84a27d7 | Short hash of the git commit used to build the Docker image in this repository |
PHP_VERSION | 8.3 | PHP version included in the image |
NODE_VERSION | 22 | NODE version included in the image |
version: '3.9'
services:
web:
image: virtuasa/php-dev:8.3-nginx-node-22-bookworm-sury
user: ${FIXUID:-1000}:${FIXGID:-1000}
volumes:
- .:/data
links:
- db
- redis
environment:
- HISTFILE=/data/var/.docker_bash_history
- HISTFILESIZE=1000
- DOCUMENT_ROOT=public
- SSL_CERT_PEM=/data/setup/ssl/app.crt
- SSL_CERT_KEY=/data/setup/ssl/app.key
- SSL_FORCE=yes
- SERVER_NAMES=app.amce.docker
- XDEBUG_MAIN_HOST=app.amce.docker
- XDEBUG_CLIENT_HOST=host.docker.internal
extra_hosts:
- 'host.docker.internal:host-gateway'
labels:
- "com.dnsdock.alias=app.amce.docker"
Content type
Image
Digest
sha256:f1c237aa9…
Size
400.2 MB
Last updated
8 days ago
docker pull virtuasa/php-dev:5.6-nginx-node-18-bookworm-sury