fititnt / uwazi-docker

Dockerized version of Uwazi (“openness" in Swahili). HURIDOCS designed Uwazi to make human rights information more open and accessible to the defenders who need it.
The Unlicense
11 stars 4 forks source link

use bind mounts instead of named volumes #38

Open vasyugan opened 5 years ago

vasyugan commented 5 years ago

This is maybe a matter of taste, but I find the use of bind mount for databases, documents and dumps preferable over using named docker volumes, because it eases backup and restore, it survives when I wipe /var/lib/docker, so my precious user data is safe. So in my local install, the uwazi service has the following volume parameter:

volumes:
  - ./documents:/home/node/documents
  - ./dump:/home/node/dump
  - ./log:/home/node/log

and mongo has:

volumes:
 - ./data/mongo:/data/db
 - ./dump:/dump

I don't care about elasticsearch, because in my understanding, that's no persistent data. I have added a directory for dumps, because for backup purposes I do a daily mongodump and I want to have access to it.

fititnt commented 5 years ago

I agree. In fact it was the the default before use of volumes and I personally like to use the way you do in production.

What do you think about, to start, add these information as additional comment on the docker-compose.yml for now, and eventually we consider put (or not) as default?

Also, maybe with these comments, experience, etc we eventually will archive some docker-compose for production usage (see https://docs.docker.com/compose/production/)