There are official images for deploying WordPress and using wp-cli. But when they were used together, I had to share the entire WordPress folder and wanted more options for customizing the installation.
I really wanted to see the browser in the browser, not an invitation to choose the installation language, but a finished site.
This article offers one way to deploy WordPress sites.
git clone https://github.com/eustatos/wordpress-docker-dev-env.git
or if you prefer
git clone firstname.lastname@example.org:eustatos/wordpress-docker-dev-env.git
cd wordpress-docker-dev-env docker-compose up -d docker-compose exec -T wp-cli sh < install.sh
This completes the installation. Open
localhost:8080 in your preferred browser.
Access to admin panel
User Login -
User Password -
You can change these and other environment and installation variables in the
wp-content folder appears in the project folder, where you can create and / or change themes and plugins.
If there are problems with file permissions in the
sudo usermod -a -G www-data $USER
You can control the assembly as conveniently. For example, if you do not need to create themes and / or plugins by default, just make changes to
You can learn more about the capabilities of
wp core install
Topic Creation Example
For example, to create an
underscores based theme, run the following command
docker-compose exec -T wp-cli wp scaffold _s \ sample-theme \ --theme_name="Sample Theme" \ --author="John Doe"
This command will create a
sample-theme folder in the
wp-content folder with the theme files and you can immediately start modifying it.
In conclusion, a short video for clarity: