Sign inSign up

aheadworks/php-m2

By aheadworks

Updated 5 months ago

Dockerized PHP configured to run Magento 2

Image
0

4.8K

aheadworks/php-m2 repository overview

docker-php-m2

PHP-fpm preset to run Magento 2

General information

Supported versions

8.2, 8.3 and 8.4 are supported.

5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 are still available but deprecated. No rebuilds are planned for these tags.

Starting from 7.4 Composer 2 and Magento 2.4.0+ crontab is used by default -legacy images are built with composer 1 and an older Magento crontab file (2.3.7 and below)

Adding fresh PHP versions
  1. Edit config.yaml file by adding new PHP version to the out list in this file
  2. Add new tags to Dockerhub (Set Autobuild value to OFF) https://hub.docker.com/repository/docker/aheadworks/php-m2/builds/edit
  3. Push changes to the master branch to trigger build

(optional) in case you want to get dockerfiles for a local build execute docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) -v ${PWD}:/data m4x0nus/multiplicator update -d /data -c /data/config.yaml

PHP extensions bundled
  • bcmath
  • ftp
  • intl
  • mysqli
  • newrelic
  • opcache
  • pdo_mysql
  • soap
  • sockets
  • xdebug
  • xsl
  • zip

Usage

Run mode

This image can run in fpm_only(default), cron_only or both.

In cron_only mode only crontab is launched with confg stored in conf/crontab

In fpm_only mode the cron is not launched.

To specify run mode, set MODE environment variable to corresponding value.

FPM configuration variables
  • FPM_USER, default www-data
  • FPM_GROUP, default www-data
  • FPM_UID
  • FPM_GID
PHP configuration variables
  • PHP_MEMORY_LIMIT, default 1024M
  • PHP_POST_MAX_SIZE, default 256M
  • PHP_UPLOAD_MAX_FILESIZE, default 256M
  • PHP_MAX_INPUT_VARS, default 100000
  • PHP_SESSION_GC_MAXLIFETIME, default 86400
  • PHP_REALPATH_CACHE_SIZE, default 10M
  • PHP_REALPATH_CACHE_TTL, default 7200
Mail configuration variables
  • SSMTP_HOST, default mail
  • SSMTP_PORT, default 25
  • SSMTP_USE_STARLTLS, defaults no
  • SSMTP_USE_TLS, defaults no
  • SSMTP_AUTH_USER
  • SSMTP_AUTH_PASSWORD
New Relic configuration variables
  • NEW_RELIC_KEY, empty by default
  • NEW_RELIC_APPNAME, empty by default Newrelic is enabled only if both variables are set
XDebug configuration variables
  • XDEBUG_ENABLED, defaults false. Set to 1 to enable XDebug
  • XDEBUG_IDEKEY, default PHPSTORM
  • XDEBUG_REMOTE_ENABLE, default on
  • XDEBUG_REMOTE_PORT, default 9001
  • XDEBUG_REMOTE_CONNECT_BACK, default 1
  • XDEBUG_REMOTE_HOST, default host.docker.internal

Contribution

Files & folders structure
  • out - directory to produce PHP version-specific configurations
  • legacy - directory containing unmaintained PHP versions
  • skeletons - directory containing a sample structure
  • skeletons/php/bin
    • build - Scripts used at image build stage(e.g. install&compile PHP extensions)
    • cmd.sh - Docker command file executed on image startup
  • skeletons/php/conf
    • crontab - crontab file for image in cron_only or both run mode
    • ssmtp.conf.tpl - ssmtp config file
  • skeletons/php/Dockerfile.template - template for version-specific dockerfiles used by update script

Tag summary

Content type

Image

Digest

sha256:9e91197c2

Size

87.5 MB

Last updated

5 months ago

docker pull aheadworks/php-m2:8.4