I am deploying Seafile using docker in a Ubuntu 20.04 DigitalOcean droplet. In that droplet I also have a blockstore volume attached for extra storage, I mounted it at /mnt/shared.
After reading Seafile documentation I expected that if I set:
/opt/seafile-data:/mnt/shared in the docker-compose.yml then Seafile would store all the data outside the docker filesystem, in the server filesystem at /mnt/shared. However Even if everything seems to work perfectly and I can upload files, I don’t see anything under /mnt/shared, the folder is empty. Actually I have no idea of where the data is stored. If I look for example for seafile.log:
I am afraid that this is just me not knowing exactly how docker works. I would also expect the database to be located at /var/lib/mysql but there is nothing there and however there are data/files at /opt/seafile-mysql
Please let me know how can I find out where the files are stored and how would I be able to store the data/files outside the docker instance, in the /mnt/shared folder of the server.
@m_elias looks like I can’t add links to my posts, weird.
For now I used the following DigitalOcean tutorials:
the tutorial how-to-install-and-use-docker-on-ubuntu-20-04
and ufw-essentials-common-firewall-rules-and-commands (I opened ports 80 and 443)
Then I created a volume in DigitalOcean, attached it to my droplet, and mounted it in /mnt/shared
Then from the Seafile documentation I looked at the page “Deploy Seafile with Docker” where they provide an example for the docker-composer.yml file, and I created the docker-compose.yml file that I added in my previous post.
Then I just run the docker using
docker-compose up -d
So it is fixed now. @m_elias
The problem was that I was incorrectly using the paths inside “volumes:”. Basically you have
path_in_host:path_in_container
So when I was doing:
volumes:
/opt/seafile-data:/mnt/shared
I was actually trying to attach the container path /mnt/shared to my host path /opt/seafile-data. Which is the opposite than what I wanted to do. So the right thing to do is:
volumes:
/mnt/shared/seafile-data:/shared
Which attach the container /shared folder to the host folder /mnt/shared/seafile-data, and /mnt/shared is the folder in which I mounted the Digital Ocean blockstore volume. And in the same way you can also move the database to the blockstore volume:
@diegosb Thanks for clarifying that. It appears to have worked for me, other then being a docker-compose noob, I wasn’t sure where to put the docker-compose.yml file and I didn’t realize I needed sudo for starting docker-compose. I just created ~/seafile_compose dir and put the yaml in there.