Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/strarsis/docker-php-bedrock

Docker image for PHP with roots.io Bedrock
https://github.com/strarsis/docker-php-bedrock

Last synced: 13 days ago
JSON representation

Docker image for PHP with roots.io Bedrock

Awesome Lists containing this project

README

        

# docker-php-bedrock
Docker image for PHP with roots.io [Bedrock](https://github.com/roots/bedrock) WordPress sites, attempting high parity with roots.io [Trellis](https://github.com/roots/trellis) PHP FPM.

## PHP releases
There are currently two branches available for the two major PHP versions:
- [PHP 7.4](https://github.com/strarsis/docker-php-bedrock/tree/php7.4)
- [PHP 8.0](https://github.com/strarsis/docker-php-bedrock/tree/php8.0)

## Architecture

### Comparison with the WordPress Docker Hub image
This image isn't derived from the [Docker Hub WordPress](https://hub.docker.com/_/wordpress) repository, as the WordPress core of Bedrock based sites is installed as a dependency using `composer`. The roots.io packaged WordPress core has also its default themes stripped (https://github.com/roots/bedrock/pull/555).

### WP CLI
The docker-php-bedrock image tries to contain only a sane runtime for WordPress Bedrock applications and no other tooling like WP CLI support or SSH access.
Instead a [WP CLI](https://hub.docker.com/_/wordpress?tab=tags&page=1&ordering=last_updated&name=cli) container should be connected with and mounted into the container, so that it can access the WordPress configuration and site database for maintenance.

## PHP Extensions parity overview

| Extension | [Trellis](https://github.com/roots/trellis) | [Docker PHP 7 FPM](https://hub.docker.com/_/php/tags?page=1&name=7) | [Docker PHP 8 FPM](https://hub.docker.com/_/php/tags?page=1&name=8) | [docker-php-bedrock (PHP 7.4 FPM)](https://github.com/strarsis/docker-php-bedrock/tree/php7.4) | [docker-php-bedrock (PHP 8.0 FPM)](https://github.com/strarsis/docker-php-bedrock/tree/php8.0) |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------ | ------------------------------ | ------------------------------ |
| [**WordPress recommended**](https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) | | | | | |
| [curl](https://www.php.net/manual/book.curl.php) | ✅ (php*-common) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [dom](https://www.php.net/manual/book.dom.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [exif](https://www.php.net/manual/book.exif.php) | ✅ (built in) | ❌ | ❌ | ✅ (docker-php-ext-install) | ✅ (docker-php-ext-install) |
| [fileinfo](https://www.php.net/manual/book.fileinfo.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [hash](https://www.php.net/manual/book.hash.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [json](https://www.php.net/manual/book.json.php) | ✅ (php*-common) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [mbstring](https://www.php.net/manual/book.mbstring.php) | ✅ (php*-common; php*-mbstring) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [mysqli](https://www.php.net/manual/book.mysqli.php) | ✅ (built in) | ❌ | ❌ | ✅ (docker-php-ext-install) | ✅ (docker-php-ext-install) |
| [sodium](https://www.php.net/manual/book.sodium.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [openssl](https://www.php.net/manual/book.openssl.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [pcre](https://www.php.net/manual/book.pcre.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [imagick](https://www.php.net/manual/book.imagick.php) | ✅ (php*-imagick) (since Trellis >1.8.0 https://github.com/roots/trellis/pull/1292) | ❌ | ❌ | ✅ (pecl) | ✅ (workaround (pickle*2)) |
| [imagick with GhostScript (for PDF)](https://www.php.net/manual/en/imagick.requirements.php#imagick.requirements.nix) | ✅ ([ghostscript package](https://github.com/roots/trellis/blob/6bab80b988adaa81e71b4e4a67c55feead1715f0/roles/common/defaults/main.yml#L27); [+PDF config](https://github.com/roots/trellis/blob/6bab80b988adaa81e71b4e4a67c55feead1715f0/roles/php/tasks/main.yml#L50-L56)) (since Trellis >1.8.0 https://github.com/roots/trellis/pull/1292) | ❌ | ❌ | ✅ (pecl) | ✅ (workaround (pickle*2)) |
| [xml](https://www.php.net/manual/book.xml.php) | ✅ (php*-common) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [zip](https://www.php.net/manual/book.zip.php) | ✅ (php*-common; php*-zip) | ❌ | ❌ | ✅ (docker-php-ext-install) | ✅ (docker-php-ext-install) |
| [**WordPress fallback**](https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions:~:text=modules%20WordPress%20may%20use) | | | | | |
| [filter](https://www.php.net/manual/book.filter.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [gd](https://www.php.net/manual/book.image.php) | ❌ (since Trellis https://github.com/roots/trellis/pull/1292; but no auto-uninstall) | ❌ | ❌ | ✅ (docker-php-ext-install) | ✅ (docker-php-ext-install) |
| [iconv](https://www.php.net/manual/book.iconv.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [mcrypt](https://www.php.net/manual/book.mcrypt.php) | ❌ | ❌ | ❌ | ✅ (pecl) | ✅ (pickle*2) |
| [simplexml](https://www.php.net/manual/book.simplexml.php) | ✅ (php*-common; php*-xml) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [xmlreader](https://www.php.net/manual/book.xmlreader.php) | ✅ (php*-common; php*-xml) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [zlib](https://www.php.net/manual/book.zlib.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in) |
| [**WordPress update/write themes/plugins**](https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions:~:text=extensions%20are%20used%20for%20file%20changes) | | | | | |
| [ssh2](https://www.php.net/manual/book.ssh2.php) | ❌ | ❌ | ❌ | ❌ | ❌ |
| [ftp](https://www.php.net/manual/book.ftp.php) | ✅ (built in) | ✅ (built in) | ✅ (built in) | ✅ (built in)
| ✅ (built in)*1 |
| [sockets](https://www.php.net/manual/book.sockets.php) | ✅ (built in) | ❌ | ❌ | ❌ | ❌ |
| [**Trellis additional/differing extensions**](https://github.com/roots/trellis/blob/68e313ffc1a2c34badfcc22cda6a5aaba11ec2f9/roles/php/defaults/main.yml#L4) | | | | | |
| [mysql](https://www.php.net/manual/book.mysql.php) | ✅ (php*-common; php*-mysql) | ❌ | ❌ | ❌ | ❌ |
| [opcache](https://www.php.net/manual/book.opcache.php) | ✅ (php*-common; php*-opcache) | ❌ | ❌ | ✅ (docker-php-ext-install) | ✅ (docker-php-ext-install) |
| [**WooCommerce optional (some plugins)**](https://docs.woocommerce.com/document/server-requirements/#section-2) | | | | | |
| [soap](https://www.php.net/manual/book.soap.php) | ❌ | ❌ | ❌ | ❌ | ❌ |
| **Extra (extensions deemed useful, e.g. by Trellis project)** | | | | | |
| [bcmath](https://www.php.net/manual/book.bc.php) | (php*-bcmath) (since https://github.com/roots/trellis/pull/1299) | ❌ | ❌ | ❌ | ❌ |

*1: SSH/FTP/Sockets remote access for WordPress to write theme/plugin files isn't needed for container usage, but is already built into the PHP Docker Hub image.

*2: [pickle](https://github.com/FriendsOfPHP/pickle) is a new PHP extensions installer, also supporting PHP 8. `pecl` has issues with PHP 8.x.