Sign inSign up

bmeme/php

By bmeme

•Updated 3 months ago

Bmeme Docker Image packaging for PHP

Image
0

10K+

bmeme/php repository overview

Maintenance MIT license

⁠PHP Packaged by Bmeme

PHP docker images based on official PHP repository⁠, currently used by Bmeme for its development purposes, particularly suitable for Drupal or Symfony environments.

⁠What is contained in the images

  • PHP, of course
  • Some useful executables like:
    • gnupg
    • git
    • patch
    • mysql-client
    • python3
    • vim
    • zip
  • The following php extensions
    • bcmath
    • gd
    • intl
    • igbinary
    • mcrypt
    • oauth
    • opcache
    • pdo_mysql
    • pdo_pgsql
    • phpredis
    • sockets only 8.0 and older
    • zip
  • Composer
  • Ansible (used in Bmeme for all automation tasks)

⁠Existent tags not more supported

⁠How to use this image

⁠Manually

Starting your PHP environment is really simple:

$ docker run --name myphpcontainer -p 8080:80 -d bmeme/php:latest

Obviously you can change the local binding port matching your needs.

⁠Using a Dockerfile
FROM bmeme/php:latest
COPY src/ /var/www/html/

Where src/ is the directory containing all your PHP code.

Then, run the commands to build and run the Docker image:

$ docker build -t myphpimage:latest .
$ docker run -d --name myphpcontainer myphpimage:latest
⁠With a database image
$ docker run --name mydatabase -e ALLOW_EMPTY_PASSWORD=yes bitnami/mariadb:latest
$ docker run --name myapplication --link mydatabase -d bmeme/php:latest

⁠Custom environments

⁠PHP settings environments
Variable NameDescriptionDefault
COMPOSER_HOMEhome directory where composer will store packages and configuration./var/www/.composer
TIMEZONEImage TimezoneEurope/Rome
PHP_MEMORY_LIMITmemory_limit PHP value512M
PHP_MAX_EXECUTION_TIMEmax_execution_time PHP value60
PHP_LOG_ENABLEDlog_errors PHP value. Boolean.1
PHP_ERROR_LOGerror_log PHP value./tmp/php_errors.log
PHP_UPLOAD_MAX_FILESIZEupload_max_filesize PHP value.20M
PHP_POST_MAX_SIZEpost_max_size PHP value.20M
PHP_SENDMAILsendmail_path PHP value./usr/local/sendmail
⁠OpCache config environments
Variable NameDescriptionDefault
OPCACHE_ENABLEDopcache.enable PHP value1
OPCACHE_MEMORY_CONSUMPTIONopcache.memory_consumption opcache config value128
OPCACHE_INTERNED_STRINGS_BUFFERopcache.interned_strings_buffer opcache config value8
OPCACHE_MAX_ACCELERATED_FILESopcache.max_accelerated_files opcache config value4000
OPCACHE_REVALIDATE_FREQopcache.revalidate_freq opcache config value60
OPCACHE_FAST_SHUTDOWNopcache.fast_shutdown opcache config value1

For more infos about OpCache configuration @see https://www.php.net/manual/en/opcache.configuration.php⁠

⁠Using docker-compose

version: "3.1"
services:
  php:
    image: bmeme/php:latest
    ports:
      - 8080:80
    environment: # just as example
      - PHP_MEMORY_LIMIT=256M
      - OPCACHE_ENABLED=0
  mariadb:
    image: bitnami/mariadb:latest
    environment:
      - ALLOW_EMPTY_PASSWORD: yes
      - MARIADB_DATABASE: mydatabase
      - MARIADB_USER: myuser
      - MARIADB_PASSWORD: secret

⁠Credits

This project is a contribution of Bmeme :: The Digital Factory⁠. This library is actually maintained by Daniele Piaggesi⁠ and Roberto Mariani⁠. Any other contribution will be really appreciated.

Tag summary

Content type

Image

Digest

sha256:552113c70…

Size

266.4 MB

Last updated

3 months ago

docker pull bmeme/php