Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mount DDEV database to host filesystem instead of inside docker volume

Tags:

docker

ddev

I've a project with a large database (more or less 50GB) and since i have to run also other projects with docker/ddev this could be a problem, i for sure can make the size of the docker disk but i wanted to know if it's possible for a certain project keep the database outside docker...
With plain docker (docker-compose) projects i keep a "data" folder that's not inside docker, i would like to do more or less the same thing with ddev if it's possible.
Now i'm on OSX, but if it's possible also in Win10 it would be great.
Thanks!

like image 682
Francesco Avatar asked Dec 29 '25 22:12

Francesco


1 Answers

Another option, of course, is to run a MySQL/MariaDB server on your host computer, for that huge database. Your project could then access the database on the host using the hostname "host.docker.internal". This gets you into the business of running and managing your own database server on the host, but with a huge database it might be appropriate. You could also run the db server elsewhere on your local network, which is the same basic idea; the db server just has to be accessible from inside the web container. In either of these cases, you could use omit_containers: [db] and just not use the db container at all.

like image 190
rfay Avatar answered Dec 31 '25 10:12

rfay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!