We are rewriting the way images are being built. We want to make developers’ lives easier by providing clear starting points for creating containers to run on Stack.
Currently, there are two deployment styles we want to support. One is the classical way, having everything under wp-content (except for media files) in the git repository.
The other one is Bedrock, which uses Composer to manage plugins, themes and the WordPress code itself, as project dependencies. The user is responsible for installing the integration mu-plugin and object-cache.php. Also worth mentioning is that right now the Bedrock structure is also deeply integrated in the way Composer works.
That said, what we want to achieve with the new image build process is:
- keep git as a source of truth for everything code
- provide parity between local development and production
- improve build times (from 1 minute to a few seconds)
- provide integration points: custom Nginx, PHP and WP configs
- and also offer a solution for users that do not use Bedrock.
#How do we plan to do it?
A PHP-runtime base image which contains the minimum set of recommended WordPress PHP extensions is the starting point. The image is tagged both with a specific version and a full version, eg. quay.io/presslabs/php-runtime:7.3 and quay.io/presslabs/php-runtime-7.3.7.
On top of it, we create the wordpress-runtime for the classic setup. The image includes a specific WordPress version and can be used as is, but also provides an ONBUILD trigger which copies wp-config.php, wp-content, and config folders into their appropriate locations. The wordpress-image is tagged with WordPress full version, eg: quay.io/presslabs/wordpress-runtime:5.2.2.
For Bedrock, the starting point is also the PHP-runtime. We build two tags, one for building the image quay.io/presslabs/wordpress-runtime:bedrock-build and one for actually running the site, quay.io/presslabs/wordpress-runtime:bedrock. The Bedrock build image is optimised for build speed (eg. caches composer dependencies between builds) while the Bedrock runtime image is optimised for size.
All wordpress-runtime images are matrix-ed with the PHP-runtime, so for each flavour of wordpress-runtime the following tags apply: