Skip to content

Compose with MySQL

Overview

Persisting Data With Volumes

While the container created above is a fully functioning MySQL server, you need to set up volumes so your data isn’t lost when the container stops. The MySQL Docker image is configured to store all its data in the /var/lib/mysql directory1. Mounting a volume to this directory will enable persistent data storage that outlives any single container instance.

Reference