Docker Community Forums

Share and learn in the Docker community.

Docker and Mysql - Data are lost after restart Container


(Phzanetti) #1

Hi!

I’m trying to deploy an application made in AngularJS consuming REST services and persists in MySql base.
For this we created three containers, one for each layer.
The problem is that when the service is stopped docker stop cntr-project-db, the base data is deleted.

The Container database was created using volume, I thought that would be enough.
docker run -d --name cntr-project-db = -e MYSQL_ROOT_PASSWORD mypass -p 3306: 3306 -v / var / lib / docker / data / mysql / var / lib / mysql mysql -t
Inside the folder / var / lib / docker / data / mysql in my host were created multiple files but nothing done.

Suggestions, please?
I thank in advance. Hugs