This provide a simple Docker Compose configuration for creating a LAMP environment.
Having Docker
and docker-compose
isntalled, as well as a local install of composer
.
- Download any WordPress version, and place it in a
wordpress
sub-folder of the root folder (the folder where thedocker-compose.yml
file is located. - Open a terminal and run
docker-compose up -d
- Open a browser and go to
localhost:8000/wordpress/
- Complete WordPress 5-min install with the following database credentials:
- Database name: wordpress
- Database user: wordpress
- Database password: wordpress
- Database host: database
- Download any WordPress version, and place it in a
wordpress
sub-folder of the root folder (the folder where thedocker-compose.yml
file is located. - Download the matching version of WordPress tests utilities for PHPUnit, place the
includes
folder intowordpress-tests-lib
. - Clone Polylang, Polylang-Pro or any third-party plugin repository inside the root folder (along the
docker-compose.yml
file. - For each plugin, run the
composer install
andnpm install
from your local machine. - Open a terminal and run
docker-compose up -d
- Check PHP running container's name with
docker ps
, it should look likedocker-lamp_webserver_*
. - Connect into the running container with
docker exec -it docker-lamp_webserver_*
. - Step into Polylang directory (
cd polylang
). - Run the test from CLI
vendor/bin/phpunit
/!\ Warning: The database used will be the same than for the webserver, so all data will be reset each time the test are run!
After having run the container once, you can delete the stored databases with docker-compose down --volumes
from the folder that contains the docker-compose.yml
file.