Version: 0.1.0-alpha
This is a repository starter for local WordPress development using Docker.
- Docker for Mac/Windows
- nginx:latest
- phpfpm:latest (php7)
- mysql:latest
- memcached (with a d) object cache
- mailhog
- xdebug
- composer
- wp-cli
- Clone this Repo
- cd into the cloned directory
- Set environmental variables in
.envfile - Run
docker-compose up -d - Update your hosts file consistent with this example:
127.0.0.1 localhost wordpress.lift - Go to http://wordpress.lift and hopefully everything just worked.
- SSH into the php container
docker exec -it php /bin/bash - Ensure wp-cli is setup
wp --info - Ensure cron can loop back to WordPress
wp cron test - Ensure the object cache can persist data
wp cache set foo barthen,wp cache get foo
- Access Mailhog at http://wordpress.lift:8081
- Add a new theme folder to
code/themesor require it withcomposer.json - Activate it from the admin
- Make an awesome theme!
- Add a new plugin folder to
code/pluginsor require it with composer.json - Activate it from the admin
- Make an awesome plugin!
- List containers:
docker ps -a - SSH into a container:
docker exec -it nginx /bin/bash - Bring the environment down:
docker-compose down - Bring the environment down and remove orphaned containers:
docker-compose down --remove-orphans - Restart a container:
docker-compose restart nginx - Rebuild containers:
docker-compose up -d --build - View logs from a container:
docker-compose logs proxy
Use these at your own risk
- Stop all containers:
docker stop $(docker ps -aq)All containers, not just this environment's - Kill all containers:
docker rm $(docker ps -aq) - Destroy all container images:
docker rmi -f $(docker images -q) - Destroy all mounted volumes:
docker volume rm $(docker volume ls |awk '{print $2}')
- Create a workflow where full project manifests are stored in a composer.json
- Add PHPunit container attached to a separate mysql container
- Add node.js container with npm and webpack and preconfigured build scripts
- Add PHP CodeSniffer
- Add deploy scripts
- Add CI scripts