Official Instructions for FUSE Extension in Docker leads to errors

I am new to Seafile, and only a casual home server user/admin/noob.

I have successfully followed the instructions for setting up Seafile CE via Docker on Ubuntu 20.04. I can access the web portal via a no-ip domain and sync to Windows via the client.

I am trying to setup FUSE as I want to be able to backup the actual files. Following the instructions here: https://manual.seafile.com/extension/fuse/#how-to-start-seaf-fuse-in-docker

My docker-compose yml:

version: '2.0'
services:
  db:
    image: mariadb:10.5
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=*************  # Requested, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /home/jonathan/seafile/seafile-mysql/db:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
    networks:
      - seafile-net

  memcached:
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net

  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /home/jonathan/seafile/seafile-data:/shared
      - type: bind
        source: /home/jonathan/seafile/seafile-fuse
        target: /seafile-fuse
        bind:
          propagation: rshared
    privileged: true
    cap_add:
      - SYS_ADMIN
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=*************  
      - TIME_ZONE=***** 
      - SEAFILE_ADMIN_EMAIL=**********@gmail.com 
      - SEAFILE_ADMIN_PASSWORD=**************
      - SEAFILE_SERVER_LETSENCRYPT=true
      - SEAFILE_SERVER_HOSTNAME=*******.ddns.net
    depends_on:
      - db
      - memcached
    networks:
      - seafile-net

networks:
  seafile-net:

Leads to the following error:

ERROR: The Compose file './docker-compose.yml' is invalid because:
services.seafile.volumes contains an invalid type, it should be a string

Any assistance please?

Ok I have made a little progress.

This syntax is called “Long Syntax” and requires the docker-compose.yml to be version 3.2 or higher.

version: '3.2'

I could then:
docker-compose down
docker-compose up -d

Bashing into the seafile container I then ran:
./seaf-fuse.sh start /seafile-fuse

which led to the next error:

Starting seaf-fuse, please wait ...
fuse: bad mount point `/seafile-fuse': No such file or directory
Failed to start seaf-fuse

So I ran: mkdir /seafile-fuse and tried again which worked. I can now see the library files in /seafile-fuse inside the container.

Nothing is visible from host in /home/jonathan/seafile/seafile-fuse yet however …

Actually changing to 3.3 is even better:

version: '3.3'

To be honest, I have no idea how any of this works: Docker documentation states “Bind propagation is an advanced topic and many users never need to configure it.” Use bind mounts | Docker Documentation

It still doesn’t work. The error is now:

ERROR: for seafile  Cannot start service seafile: path /home/jonathan/seafile/seafile-fuse is mounted on /home but it is not a shared mount

Still looking for some help here!

I am following a trail:

This may be related to the fact that I have docker installed via snap on ubuntu 20.04.

Well at least in my case I can use seadrive cli to mount the account of the admin user which has all the libraries for my install that are then shared with regular users. But I guess if you want everything for all users mounted you need to do what you are doing.

As to docker I would not load docker via a snap. Snaps and flatpaks run in a sandbox which is not a great idea for anything that has to interact with the filesystem (I avoid them). Because of that running docker in a snap may cause issues with mounting a container volume externally.

Load it directly with apt using their repo to get the latest or run the get docker script that does that all in one step. Make sure your ubuntu admin user is added to the docker group (I think the script does that). I spin up portainer to manage docker.

I also set up pip and pipx and then can load the latest docker-compose easily.
get pip installed (via sudo). Install pipx using pip (sudo). Set env and path. Now just run pipx install docker-compose
PIPX_BIN_DIR=/opt/python/apps/bin
PIPX_HOME=/opt/python/apps
put that bin directory in your path

One wonders if seafile-fuse can be run stand alone outside the container? If so then for example I have my blocks mounted on the host already and I could fuse mount them there and then backup. Actaully I’d just backup the blocks and only fuse mount them if the backups are needed. That’s probably the best idea since the blocks are already “compressed”.

version: '2.0'
services:
  db:
    image: mariadb:latest
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD= # Requested, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /data/files-server/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
    ports:
      - "11360:3360"
    restart: unless-stopped
    networks:
      - seafile-net

  memcached:
    image: memcached:latest
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    restart: unless-stopped
    networks:
      - seafile-net

  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    ports:
      - "11080:80"
    #     - "443:443"  # If https is enabled, cancel the comment.
    volumes:
      - /data/files-server/data:/shared # Requested, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD= # Requested, the value shuold be root's password of MySQL service.
      - TIME_ZONE=America/Los_Angeles # Optional, default is UTC. Should be uncomment and set to your local time zone.
      - SEAFILE_ADMIN_EMAIL= # Specifies Seafile admin user, default is 'me@example.com'.
#      - SEAFILE_ADMIN_PASSWORD= # Specifies Seafile admin password, default is 'asecret'.
      - SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
      - SEAFILE_SERVER_HOSTNAME=files.gpccaor.net # Specifies your host name if https is enabled.
    depends_on:
      - db
      - memcached
    restart: unless-stopped
    networks:
      - seafile-net

networks:
  seafile-net: null

so if I backup /data/files-server/ I have a complete system backup. In theory I just restore those, maybe sure my compose points to them and restart the containers and I should get an identical install.

Thanks @dkblr

Following these as recommended:

Then

sudo snap remove --purge docker
sudo apt install docker-ce docker-ce-cli containerd.io
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

And now it works!

tldr:
Use version 3.3 or above in the docker-compose file
Docker from snap does not work. Use the package manager as per the normal install instructions.

1 Like