Assuming you already know how to use docker and basics of WordPress theme and plugin developments.
If you already don't know much you can check the following links.
This is good practice not to touch WordPress core. All of our works will based on themes and plugins folders. So we will make a system where themes and plugins folders are accessible from out side of container so that if we change the plugin or theme code then the effect will be applied immediately on development site.
- Let's create
docker-compose.ymlfile in our development folder.
- Define the services.
docker-compose upcommand to up and running our development environment.
For our development process we need three services container
- Database ( MySQL )
- phpmyadmin ( database browser )
phpmyadmin is optional we are using this if we need to browse the data for development purpose. You can skip it if you want.
Let's see how we can define these services.
Edit the `docker-compose.yml' file and follow the steps.
- Define the docker compose version at the very top like this
- Define database container
- Define WordPress container
- Define Phpmyadmin container