greyltc / docker-owncloud

Arch linux based docker container with owncloud
111 stars 37 forks source link

[Question] Is it possible to assign a storage location outside the container? #76

Closed raqbit closed 8 years ago

raqbit commented 8 years ago

I have a raid config which I would like to store my data on, to prevent data loss.

How would I be able to do this? Is there builtin support for this?

greyltc commented 8 years ago

Yeah, it's possible. Previously I've recommended using docker's volume mount functionality to map a folder on your docker host machine directly to /usr/local/webapps/owncloud/data/. This is nice because everything in owncloud's data folder is then stored outside the container, including its sqlite database. This is the "Docker way"

You might also experiment with the following method:

Use docker's volume mount flag (-v, read about it here) to mount a folder on your raid storage at /mnt in the container. Then in ownCloud, enable the "External storage support" plugin and add external storage of type "Local" and point it at /mnt. I think that might be the safest, best way to store just your data outside the container. This is the "ownCloud way". Note that there are other aspects of your ownCloud server that you might also want to protect from data loss events (such as the ownCloud database and your server configuration for example).