Migrating from native Seafile CE to official Docker container (arm64)

Dear all,

I would like to migrate from a native installation of Seafile CE to the Docker version, for arm64. I have followed the steps described here but I can’t get it to work.

If I use the default docker-compose.yml, I can create a new working instance of a Seafile server no problem, which means that, at least in principle, I am able to run Seafile CE with Docker. However, if I amend docker-compose.yml to use the natively installed MariaDB server (accessible from beyond localhost for both the root and seafile users) conf files (amended as described in the post hyperlinked above) and storage, it does not work

version: '2.0'
services:

  memcached:
    platform: linux/arm64
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net
          
  seafile:
    platform: linux/arm64
    image: seafileltd/seafile-mc:9.0.2 
    container_name: seafile
    ports:
      - "8866:80"
    volumes:
      - /mnt/sdcard/home/seafile/www/docker:/shared   # Requested, specifies the path to Seafile data persistent store.
      - /mnt/wdred1/seafile-data:/shared/seafile/seafile-data
    environment:
      - DB_HOST=192.168.178.2
      - DB_ROOT_PASSWD=mypassword  # Requested, the value shuold be root's password of MySQL service.
      - TIME_ZONE=Europe/Berlin  # Optional, default is UTC. Should be uncomment and set to your local time zone.
      - SEAFILE_ADMIN_EMAIL=my@email.com # Specifies Seafile admin user, default is 'me@example.com'.
      - SEAFILE_ADMIN_PASSWORD=mypassword     # Specifies Seafile admin password, default is 'asecret'.
      - SEAFILE_SERVER_LETSENCRYPT=false   # Whether to use https or not.
      - SEAFILE_SERVER_HOSTNAME=seafile.mydomain.info # Specifies your host name if https is enabled.
    depends_on:
      - memcached
    networks:
      - seafile-net

networks:
  seafile-net:

I’ve traced the issue back to seahub, seafile runs fine, if I access the container and run ./seahub.sh start I get Error:Seahub failed to start., the supposedly more verbose ./seahub.sh start-fastcgi is useless because it returns Unknown command: 'runfcgi', and no additional error logs are written anywhere. How can I debug this problem if I am not told what the problem is? Does anybody have any ideas as to how I could debug the problem?

Thank you in advance!

1 Like

Hi, instead of start-fastcgi, set the daemon variable to False in the gunicorn.conf.py config file. Then start Seahub as usual and it will print the stack trace when crashing.

Indeed, that did the trick, thanks! The reason was that the pids_dir variable in gunicorn.cong.py, which I duplicated from my native instance of Seafile, was set to a custom path specific to my setup, rather than the default /opt/seafile/pids. Changing this back to such default value solved the problem.

@daniel.pan In the process of migrating to Docker following these steps, I also found that they seem not to be complete. I would like to understand whether that is indeed the case or I did something wrong:

  • I needed to increase the access permissions not just for the MySQL seafile user but also for the MySQL root user, like so GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xyz' WITH GRANT OPTION;
  • I needed to allow connecting to my MySQL server from beyond localhost by disabling bind-address = 127.0.0.1 in /etc/mariadb.conf.d/50-server.cnf, Since, I believe, a Docker container is given an IP address in the 172.17. 0.0/16 subnet, can bind-address be set to a range specific range of IPs?
  • DB_HOST in the docker-compose.yml must be set to the local IP address of the server running the Seafile container, e.g. 192.168.178.2 for me
  • I had to change the ownership of the conf files and data in the seafile-data folder to root. With respect to this, even inside the container things seem to be run as root, is this as expected?

We will give it a check in the next week.