-
Set up a
docker-compose.yamlfile (file content at the bottom of this page). -
Also create a
data/mysqlfolder 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/UsersShared 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
mydatabaseservice in thedocker-compose.yamlfor 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