It provides WordPress, MariaDB, PHP, nginx, and PHPMyAdmin suite for WordPress development.
-
Clone or fork this repository.
-
Put your plugin or theme code in the root of this folder and adjust the
services/wordpress/volumessection ofdocker-compose.ymlso that it syncs to the appropriate directory. -
Add
mywp.testto/etc/hostslike:127.0.0.1 mywp.test
docker-compose up -dThe first time you run this, it will take a few minutes to pull in the required images. On subsequent runs, it should take less than 30 seconds before you can connect to WordPress in your browser. (Most of this time is waiting for MariaDB to be ready to accept connections.)
The -d flag backgrounds the process and log output. To view logs for a
specific container, use docker-compose logs [container], e.g.:
docker-compose logs wordpressOpen http://mywp.test/ in your browser and follow the famous five-second WordPress install.
Admin Login: http://mywp.test/wp-admin/
Use admin/admin as user/password to login.
To access the Adminer visit: http://mywp.test:8080 and use username as root and password as blank.
If you want to access the docker container with SSH, you can easily connect to docker by using the below docker command.
docker exec -it mywp-wordpress-1 bash