Sign inSign up

netinventors/php-base

By netinventors

•Updated 3 days ago

PHP base development images

Image
2

10K+

netinventors/php-base repository overview

⁠PHP base development image

Debian based development image with Apache, several PHP versions, MariaDB, Composer, Node.js and common CLI tools. It is the base of the netinventors/shopware and netinventors/typo3 images.

⁠Available architectures

  • amd64
  • arm64

⁠Tags

TagContent
latest, <version>, <version>-apacheAll PHP versions (7.3 – 8.5), PHP 8.4 is the default
<version>-php<X.Y>, <version>-apache-php<X.Y>Only PHP <X.Y> (smaller image), e.g. 1.5.0-php8.4

⁠Server services

The versions below refer to image version 1.5.0.

  • Debian Bookworm (12.15)
  • Apache 2.4.68 (mpm_prefork, mod_php, modules headers, rewrite and ssl enabled)
  • PHP versions
    • 7.3.33
    • 7.4.33
    • 8.0.30
    • 8.1.34
    • 8.2.35
    • 8.3.36
    • 8.4.27
    • 8.5.12
  • PHP modules
    • amqp
    • apcu (Apache only)
    • curl
    • gd
    • igbinary
    • imagick
    • imap
    • intl
    • mbstring
    • mcrypt
    • memcached
    • msgpack
    • mysql (mysqli, mysqlnd, pdo_mysql)
    • opcache (Apache only)
    • redis
    • soap
    • tidy
    • xdebug (Apache only, see ENABLE_XDEBUG)
    • xml
    • zip
  • AWS CLI 2.39.3
  • Symfony CLI 5.22.2
  • Composer 2.11.1 / 1.10.27
  • Cron Daemon
  • Ghostscript 10.00.0
  • ImageMagick 6.9.11-60 Q16
  • MariaDB 10.11.19 (starts optional)
  • Node.js 24.22.2 (managed by n⁠ 11.0.0)
  • NPM 11.19.1
  • OpenSSH Server
  • Supervisor Daemon 4.2.5

⁠Additional packages

  • bat (available as bat alias for the web user)
  • default-mysql-client
  • git
  • iputils-ping
  • joe
  • jq
  • less
  • nano
  • net-tools
  • rsync
  • task 3.54.0
  • tidy
  • unzip
  • vim
  • yq 4.54.1

⁠Exposed ports

PortService
22SSH
80HTTP
443HTTPS (self-signed certificate for localhost)
3306MariaDB

The container health check requests http://127.0.0.1/ping.

⁠Customizable environment variables

All described environment variables are displayed with their default values.

⁠System
Variable nameDefault value
TZEurope/Berlin
⁠Web user

The web user is created at the first container start. The user belongs to the group www-data, runs Apache and can log in via SSH.

Variable nameDefault value
WEB_USER_UID1000
WEB_USER_USERNAME"netinventors"
WEB_USER_PASSWORD"athene"
⁠Permission fixer

At each start the ownership and permissions of the cache, log and backup directories are fixed.

Variable nameDefault valuePossible valuesDescription
SKIP_PERMISSION_FIXER"false"
  • true
  • false
Skips the permission fixer completely
SKIP_HTML_PERMISSION_FIXER"true"
  • true
  • false
Skips the ownership fix of /var/www/html
⁠PHP

The currently available PHP versions are:

  • 7.3
  • 7.4
  • 8.0
  • 8.1
  • 8.2
  • 8.3
  • 8.4
  • 8.5

The tags with a -php<X.Y> suffix only contain one PHP version, which is also the default value of PHP_VERSION.

Variable nameDefault valuePossible values
PHP_INI_SCAN_DIR":/usr/local/etc/php/cli/conf.d"
APACHE_PHP_INI_SCAN_DIR":/usr/local/etc/php/apache2/conf.d"
PHP_VERSION8.4
  • 7.3
  • 7.4
  • 8.0
  • 8.1
  • 8.2
  • 8.3
  • 8.4
  • 8.5
ENABLE_XDEBUG"true"
  • true
  • false

The leading : keeps the default scan directory of the PHP version and adds the given directory.

⁠Composer
Variable nameDefault valuePossible values
COMPOSER_HOME/usr/local/share/composer
COMPOSER_VERSION2
  • 1
  • 2
UPDATE_COMPOSER"false"
  • true
  • false

Both versions are available as composer-1 and composer-2, composer links to the selected one.

⁠Node.js / NPM and Node.js module n
Variable nameDefault valuePossible values
NODE_VERSION24.22.2
NPM_VERSION11.19.1
UPDATE_NODE"false"
  • true
  • false
UPDATE_NPM"false"
  • true
  • false
UPDATE_N"false"
  • true
  • false

If NODE_VERSION or NPM_VERSION differs from the preinstalled version, the requested version is installed at container start (internet access required). NODE_VERSION accepts every version n understands, e.g. 22 or lts. The value -1 skips the installation.

⁠MySQL database server

If MYSQL_HOST is localhost or 127.0.0.1 a local MariaDB server instance will be started automatically. The variables are used by the snapshot commands and the derived images. The base image itself does not create the user or the database.

Variable nameDefault value
MYSQL_HOST"localhost"
MYSQL_PORT"3306"
MYSQL_USER"netinventors"
MYSQL_PASSWORD"athene"
MYSQL_DATABASE"app"

⁠Directories

LocationDescription
/var/www/htmlDocument root (HTTP and HTTPS)
/usr/local/share/composerComposer home and cache directory
/usr/local/etc/php/apache2/conf.dAdditional loaded PHP configuring *.ini files for the Apache
/usr/local/etc/php/cli/conf.dAdditional loaded PHP configuring *.ini files for the CLI
/usr/local/etc/boot.dShell scripts (*.sh) executed in sorted order at container start
/usr/local/etc/supervisor/conf.dAdditional supervisor program configurations (*.conf)
/usr/local/share/permission-fixerShell scripts (*.sh) fixing permissions at container start
/usr/local/share/certsCA (ca.pem, trusted in the container) and localhost certificate
/usr/local/var/logDirectory where all the logs go to (apache2, mysql, supervisor)
/usr/local/var/backupDirectory storing created snapshots

The log directory is linked as ~/log into the home directory of the web user.

⁠ImageMagick policy

The ImageMagick policy limits the resources (memory 256 MiB, map 512 MiB, disk 1 GiB, max. 16K × 16K pixels) and disables URL delegates as well as the PS, EPS and XPS coders. PDF can be read and written.

⁠Breaking changes

Some mapped volumes will now locate in different places.

Old locationNew location
/certsNo longer required
/etc/ssl/openssl.cnfNo longer required
/etc/apache2/sites-enabledNo longer required
/home/netinventors/.composer/usr/local/share/composer
/usr/local/etc/php/conf.d/usr/local/etc/php/cli/conf.d
/var/log/app/usr/local/var/log

⁠Taskfile

You can run different commands directly via task⁠. Executing task without an argument is an alias for task --list and shows the available commands.

The snapshot commands are provided as /usr/local/share/skel.d/taskfile/Snapshot.yml and are included by the Taskfiles of the derived images.

⁠Available commands
CommandDescription
snapshot:listLists available snapshots
snapshot:createCreates a snapshot
Example: task snapshot:create -- "Comment"
snapshot:restoreRestores a snapshot
Example: task snapshot:restore -- "810511133700"
snapshot:restore:filesRestores a snapshots files
Example: task snapshot:restore:files -- "810511133700"
snapshot:restore:databaseRestores a snapshots database
Example: task snapshot:restore:database -- "810511133700"
snapshot:removeRemoves a snapshot
Example: task snapshot:remove -- "810511133700"
snapshot:purgePurges all snapshots

Tag summary

Content type

Image

Digest

sha256:7639a125a…

Size

545.5 MB

Last updated

3 days ago

docker pull netinventors/php-base