July 2018
Intermediate to advanced
420 pages
8h 46m
English
A local folder to store MySQL data is very important since our docker-compose.yml file does not contain any volume that's been configured to store the data created in our database yet.
Remember, we are using Docker, and our MySQL container is based on an image of a database. This way, every time we finish the container process, our database is erased and the next time we start it, our database will be empty.
Open the docker-compose.yml file and add - ./storage-db:/var/lib/mysql right after the application volumes on the MySQL configuration block, as shown in the following code:
mysql: image: mysql:5.7 container_name: chapter-04-mysql working_dir: /application volumes: - .:/application - ./storage-db:/var/lib/mysql ...
Read now
Unlock full access