Docker-compose.yml - volumes: - what am I missing?

We are in the process of buying the professional version but I had to create a new VM to run Seafile because the one we had the CE version on didn’t meet the requirements for the latest Pro version. (Ubuntu 16.04).

So, starting from scratch (Debian 10) I installed Docker and followed these instructions: https://download.seafile.com/published/seafile-manual/docker/deploy%20seafile%20with%20docker.md

I want to put my seafile data and database on a second hard disk mounted at /data. I understood from the comments in the file that I needed to set these to the directories I wanted to use, so I edited them to be thus:

in db:
volumes:
- /opt/seafile-mysql/db:/data/seafile/mysql

in seafile:
volumes:
- /opt/seafile-data:/data/seafile/data

However when I got it running there is nothing in those directories, and I find that these directories have been created:

/opt/seafile-mysql/db - the original value
/opt/seafile-data - the original value

Am I doing this wrong or is Docker ignoring this?

Thanks.

It seems like you have the directories backwards from what you’re trying to do. The path before the colon is the local directory on your filesystem. The path after the colon is the directory inside the docker container.

So the paths should be:

  • /data/seafile/mysql:/var/lib/mysql
  • /data/seafile/data:/shared

Of course! It’s a mapping like ports, not a variable being set.

Many thanks!

Bob