README
WordPress in Docker
Command-line utility for local development with WordPress.
Installation
npm install -g wordpress-in-docker
You need both Docker and Docker-Compose installed on your dev machine.
Use
The famous 1 command install
wpd init
Run this in your project directory. You will be prompted to supply a name for your WordPress theme. Then, it will pull the required Docker images, and configure them for development. This might take a little while the first time you run it.
Once it is ready, you should see the WordPress installation screen appear in your browser. A directory will have been created for your theme. You are ready to start development.
CLI reference
Usage: wpd [options] [command]
Options | Description |
---|---|
-V, --version |
output the version number |
-h, --help |
output usage information |
Commands | Description |
---|---|
init [options] |
Initialise a wordpress-in-docker project. |
up |
Start up an existing wordpress-in-docker setup. |
shell |
Spawn an interactive shell inside the WordPress container. |
export [options] |
Export WordPress files and/or a database dump from the Docker containers to the host machine. |
up
Start up an existing wordpress-in-docker setup.
Usage: wpd up
Options | Description |
---|---|
-h, --help |
output usage information |
init
Initialise a wordpress-in-docker project.
Usage: wpd init [options]
Options | Description |
---|---|
-t, --theme <name> |
Create a blank WordPress theme with this name. |
-h, --help |
output usage information |
export
Export WordPress files and/or a database dump from the Docker containers to the host machine.
Usage: wpd export [options]
Options | Description |
---|---|
-d, --database |
Create a blank WordPress theme with this name. |
-w, --wordpress |
Create a copy of the WordPress directory. |
-h, --help |
output usage information |
References
- https://docs.docker.com/compose/wordpress/
- https://neliosoftware.com/blog/local-wordpress-development-with-docker/
- https://gist.github.com/spalladino/6d981f7b33f6e0afe6bb