luyadev / luya-kickstarter

Kickstart a new LUYA project application.
https://luya.io
MIT License
46 stars 26 forks source link

Persistent mysql data #47

Closed boehsermoe closed 4 years ago

boehsermoe commented 4 years ago

After my huge frustration of my empty database...

nadar commented 4 years ago

Sad to hear, but those images are not for production, its a good behavior in order to fully reset the database with down/up commands. Does mysql-volume:/var/lib/mysql:cached work on all os systems? Does your intention is to mount a certain mysql volume into the docker container?

boehsermoe commented 4 years ago

Of course sometime it is good to reset the containers because something was tested, but not the persistent data like the database (or media files). If u want to reset the containers inlc. volumes just need execute docker-compose down -v.

Does mysql-volume:/var/lib/mysql:cached work on all os systems?

The :cached will be ignored under linux but it does not make so much different for database volumes. So I removed it.

Does your intention is to mount a certain mysql volume into the docker container?

No, a named volume will be generated automatically stored under /var/lib/docker/volumes/

nadar commented 4 years ago

I will merge this PR, if there will be any problems regarding volume definition we can revert the commit 👍

nadar commented 4 years ago

docker-compose up

ERROR: Named volume "mysql-volume:/var/lib/mysql:rw" is used in service "luya_db" but no declaration was found in the volumes section.