WordPress Develop for ARM
This fork of wordpress-develop is compatible with ARM processors, specifically Apple Silicon chips like M1 and M2.
Usage is nearly identical to the original project (README.md).
Main differences as compared with the original project:
- Docker services use
armimage builds. - WPCLI is bundled into the PHP image, as opposed to running in seperate container. See Notes.
- Support for multiple server names with shared certificates ( no more browser HTTPS CA error headaches ).
Whether you want to contribute to WordPress core or test your own projects against bleeding edge of WordPress, the mods in this fork should speed up your time to code.
You can create multiple test servers to run simultaneosly on the nginx container.
To create 2 servers, for example, set the SERVER_NAMES env variable.
E.g. indocker-compose.override.yml:
services:
wordpress-develop:
environment:
SERVER_NAMES: 'wpdev1.local wpdev2.local'
To enable HTTPS, create public and private certificate key pair at the following locations, using mkcert:
- Replace contents of
tools/local-env/devunstuck-key.pemwith private Key. - Replace contents of
tools/local-env/devunstuck.pubwith public Key.
If you choose to rename the keys with your own custom key pair name, remember to also:
- Update the relevant
volumes:entries inwordpress-developservice. - Update
ssl_certificate_keyandssl_certificatein the nginx conf filetools/local-env/default.conf/default.templateto match.... ssl_certificate /root/custom-key-pair-name; ssl_certificate_key /root/custom-key-pair-name; ...
The custom PHP image(devunstuck / php-xdebug-wpcli-arm) may be the biggest difference between this fork and the original project. The image is based on php - Official Image, and can be used in similar fashion.
Includes:
- WP-CLI
- The official wordpressdevelop/cli image doesn't have a ARM compatible version.
Rather than running as a seperate container,
wpcliis installed directly within PHP container.
- The official wordpressdevelop/cli image doesn't have a ARM compatible version.
Rather than running as a seperate container,
- Xdebug
- strace
To run wp commands, use the wp_php user.
E.g. if the php container is named du-wordpress-develop-php-1, do:
docker exec -u wp_php du-wordpress-develop-php-1 wp help
Xdebug is enabled by default. Nginx and PHP are pre-configured to stay connected during very long xdebugging sessions.