A simple WordPress development environment using Docker.
Checkout our introductory blog post.
Download and place the wpdock executable in your path, the following command places wpdock into the $HOME/bin folder:
curl https://raw.githubusercontent.com/wpgitupdater/wpdock/main/wpdock -o $HOME/bin/wpdock && chmod +x $HOME/bin/wpdockCreates '.env' file in the current folder when not present.\nAdds 'db.sql' and '.wpdock' to '.gitignore', and '.htaccess' rules to prevent dot files being accessed.
wpdock initDisplays the contents of the generated files should you prefer a manual installation.
wpdock file .envRuns docker-compose up -d and applies wpdock specific configurations. When --https is provided a caddy server is used to proxy requests from your WORDPRESS_SITE_HOST env to the wordpress container.
wpdock up
wpdock start --httpsRuns docker-compose stop.
wpdock stopRuns docker-compose down.
wpdock downRuns docker-compose down -v, destroying volumes.
wpdock downProxies commands to the named container using docker-compose exec name ....
For example: wpdock exec wordpress sh opens a session on the wordpress container.
wpdock exec [container] [command]Proxies commands to the named container using docker-compose run name ....
For example: wpdock run wordpress ls -al runs ls -al on the wordpress container.
wpdock run [container] [command]Tails container logs. When no name is provided output contains all running containers.
wpdock logs [container]Proxies all commands to docker-compose.
wpdock compose [...args]Uses the root db user to dump the database using the WordPress cli wp db export command. Creates a dump.sql file in the project root.
wpdock dumpImports a created dump.sql using the WordPress cli wp db import command. dump.sql file must be in the project root.
wpdock importProxies commands to the WordPress cli container docker-compose run --rm cli wp ....
For example: wpdock user list >> wpcli user list
wpdock user list
wpdock search-replace 'http://' 'https://'
wpdock cli info