wodby / docker4php

Docker-based PHP stack
https://wodby.com/docker4php
MIT License
277 stars 44 forks source link

Why don't mount database? #8

Closed davidhoang101 closed 5 years ago

davidhoang101 commented 5 years ago

Why don't mount database volume by default? how can this retain changed things in database?

csandanov commented 5 years ago

We don't do that because:

  1. We don't know what is the preferred location on the host
  2. MariaDB has issues with bind mounts on macOS and Windows (see README of MariaDB https://github.com/wodby/mariadb for more details on that)

Also, without bind mounts Docker will create persistent volumes automatically (because they're specified in the image) and if you don't run docker-compose down (use stop instead) your data will remain with docker-compose up. And even if you run down the data is still will be available somewhere under /var/lib/docker unless you run docker system prune --volumes.