Seafile 12 Server on unRAID (Docker run deployment, not docker-compose)

Hi everyone,

I am seeking clarification on how the new docker deployment works on version 12. For those that don’t know unRAID uses docker run commands for its containers. It is possible to use docker compose however, not of the box the OS doesn’t support it, and it isn’t as polished of a user experience compared to the built in docker run stuff, so I’d like to continue using seafile with docker run.

On previous versions of seafile this hasn’t been an issue, but with the introduction of the .env file for docker based deployments it has become one. On prior versions I would have my database in one docker container, and seafile in another, and map all the relevant paths, usernames, passwords, etc. in the docker run command.

Here is an example of the docker run command I would use on an older version of seafile.

docker run
  -d
  --name='seafile-10'
  --net='br0'
  --pids-limit 2048
  -e TZ="America/Los_Angeles"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="server"
  -e HOST_CONTAINERNAME="seafile-10"
  -e 'TCP_PORT_80'='8080'
  -e 'SEAFILE_SERVER_HOSTNAME'='seafile.example.com'
  -e 'DB_HOST'='seafile-10-mariadb'
  -e 'DB_ROOT_PASSWD'='changeme'
  -e 'SEAFILE_ADMIN_EMAIL'='admin@changeme.com'
  -e 'SEAFILE_ADMIN_PASSWORD'='changeme'
  -e 'TCP_PORT_443'=''
  -e 'SEAFILE_SERVER_LETSENCRYPT'='false'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT:80]'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/chirmstream/unraid-templates/main/seafile-10/seafile-icon-512x512.png'
  -v '/mnt/user/seafile-10/':'/shared/':'rw' 'seafileltd/seafile-mc:10.0-latest'

Is there anyway I can pass through the new .env parameters directly to the container using docker run command? Less ideal would be passing through the location of the .env file in the docker run command, but I am unsure of how to do that as well.

If anybody has gotten seafile 12 to work on unRAID I’d love to hear how you did it. Thanks.

I am not an expert in docker, but I think what docker-compose is doing is to basically convert the config file into that sort of command line. I think you can probably do it by hand for the less complicated setups. There’s just a few things I think you need to know about how the config works.

I would welcome anyone to correct me here if you know better, but I think basically what happens is that the .env file is loaded first. It seems to just set some environment variables (which I assume is why the name).

“COMPOSE_FILE=” tells it what yaml files to parse to make containers. For each of those yaml files, there’s sections that become different options for the docker command line. For example, I think in the “environment:” section each line becomes a -e option. A lot of these might look complicated, but once you know what’s going on, it’s not so bad. Take for example:
DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}

The ${} is bash variable expansion, and the “:-” part defines a default value. So what it’s saying is that the DB_HOST should be set to the value of the SEAFILE_MYSQL_DB_HOST variable if it is set (it is set in the .env file), or if SEAFILE_MYSQL_DB_HOST isn’t set just the value “db”.

The other one you see used a few times is “:?”, which says "if this variable is not set, print this error message. So you can basically just ignore the “:?” and everything after it to the }.

Good luck.

I’m away from my server at the moment but the issue I was having was that seafile (which is already running inside a container) is searching for the docker-compose.yml file. I am already passing through the variables like how you described, so I don’t what is going on.