A simple docker-compose YAML for quickly running WordPress
$ git submodule add git@github.com:brainbytes/docker-compose-wordpress.git
$ cd docker-compose-wordpress
docker-compose up -d
The first time you run this, it might take a while to load especially if you haven't already downloaded the images. The next time will be WAY faster though.
Use docker exec <containername> wp
, for example docker exec <containername> wp theme install quark
. See the WP-CLI Docs for more info.
If you're creating a development environment from production data, the wp search-replace command may be useful, for example:
docker exec <containername> wp search-replace 'http://www.production-url.com' 'http://localhost:8000'
docker exec <containername> wp search-replace 'https://www.production-url.com' 'http://localhost:8000'
docker-compose down
docker ps
sudo docker exec -it [container name or id] bash
On Windows:
docker ps
winpty docker exec -it [container name or id] bash
On Window:
Download here and be sure to read about the prerequisites. Can't get it working? Try running this PowerShell script to diagnose common issues.
On MacOS:
Download here and have fun. It's easier to get Docker going on MacOS than Windows.
- Google it
- Follow the instructions you found
You must enable sharing for your local drive in Docker settings -> Shared Drives before volume persistance works.