-
Set up a
docker-compose.yaml
file (file content at the bottom of this page). -
Also create a
data/mysql
folder in your project. -
In order to set up a volume for MySQL in Docker Toolbox, we will need a VirtualBox Shared Folder, just like mentioned in Fixing Volumes in Docker Toolbox.
VirtualBox by default has a
c/Users
Shared Folder that we can use for this (as long as your project is withinC:\Users
. Verify that this shared folder is set up properly:
-
Add a new volume to the
mydatabase
service in thedocker-compose.yaml
for the database files. Because we are using docker-toolbox and VirtualBox, we need an absolute path, starting with//c/
:volumes:
- //c/Users/your_username/projects/wordpress-docker-stack/data/mysql:/var/lib/mysql