Public | Automated Build

Last pushed: 4 months ago
Short Description
Container for setting up Seafile with either sqlite or MySQL
Full Description

Seafile 5 for Docker

Seafile is a "next-generation open source cloud storage
with advanced features on file syncing, privacy protection and teamwork".

This Dockerfile does not really package Seafile 5 for Docker, but provides an environment for running it including startup scripts, including all dependencies for both a SQLite or MySQL (requires external MySQL database, for example in another container) setup.

Setup

The image only prepares the base system and provides some support during installation. Read through the setup manual before setting up Seafile.

Run the image in a container, exposing ports as needed and making /opt/seafile permanent. For setting seafile up, maintaining its configuration or performing updates, make sure to start a shell. As the image builds on phusion/baseimage, do so by attaching -- /bin/bash as parameter.

For example, you could use

docker run -t -i \
  -p 10001:10001 \
  -p 12001:12001 \
  -p 8000:8000 \
  -p 8080:8080 \
  -p 8082:8082 \
  -v /srv/seafile:/opt/seafile \
  jenserat/seafile -- /bin/bash

Consider using a reverse proxy for using HTTPs.

  1. After the container is started, run download-seafile to download Seafile and prepare setting it up.
  2. Once downloaded, run /opt/seafile/seafile-server-5.*/setup-seafile.sh, and go through the setup assistant. Do not change the port and storage location defaults, but change the run command appropriately.
  3. Run /opt/seafile/seafile-server-latest/seafile.sh start to start the seafile controller process.
  4. Run /opt/seafile/seafile-server-latest/seahub.sh start for configuring the web UI.
  5. If you want, do more configuration of Seafile. You can also already try it out.
  6. Setting up Seafile is finished, exit the container.

In case you want to use memcached instead of /tmp/seahub_cache/ add the following to your seahub_settings.py

CACHES = {
  'default': {
    'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
    'LOCATION': 'memcached:11211',
  }
}

Link your memcached instance to your seafile container by adding --link memcached_container:memcached to your docker run statement.

Running Seafile

Run the image again, this time you probably want to give it a name for using some startup scripts. You will not need an interactive shell for normal operation. The image will autostart the seafile and seahub processes if the environment variable autostart=true is set. A reasonable docker command is

docker run -d \
  --name seafile \
  -p 10001:10001 \
  -p 12001:12001 \
  -p 8000:8000 \
  -p 8080:8080 \
  -p 8082:8082 \
  -v /srv/seafile:/opt/seafile \
  -e autostart=true \
  jenserat/seafile

For proxying Seafile using nginx, enable FastCGI by adding -e fastcgi=true.

Updates and Maintenance

The Seafile binaries are stored in the permanent volume /opt/seafile. To update the base system, just stop and drop the container, update the image using docker pull jenserat/seafile and run it again. To update Seafile, follow the normal upgrade process described in the Seafile upgrade manual. download-seafile might help you with the first steps if already updated to the newest version.

Workaround for Seafile issue #478

If used in FastCGI mode, like recommended when proxying WebDAV, seafdav only listens on localhost:8080; with consequence that it cannot be exposed. The image has a workaround built-in, which uses socat listening on 0.0.0.0:8080, forwarding to localhost:8081. To use it, modify /opt/seafile/conf/seafdav.conf and change the port to 8081, and restart the container enabling the workaround using -e workaround478=true.

Docker Pull Command
Owner
jenserat
Source Repository

Comments (6)
axlyyj
2 months ago

hello
when I run "/opt/seafile/seafile-server-6.1.1/setup-seafile.sh"
it show "bash: /opt/seafile/seafile-server-6.1.1/setup-seafile.sh: Permission denied"
I run ls -l
it shows
"-rwxrwxr-x 1 500 500 22058 Jun 13 05:52 setup-seafile.sh"

starmagoo
8 months ago

Any ways to get seafile pro?

kerwood
2 years ago

This is awesome!.. Thanks a bunch!

starmagoo
2 years ago

Hi Jenserat,

when I want to start the docker run statement with "--link memcached_container:memcached" I get this error message:

Error response from daemon: Could not get container for memcached_container

Any ideas?

jenserat
2 years ago

@matthiss: It looks you already created a container with that name. Either use another name, drop the old container (docker rm seafile if the container is named seafile) or start the container again (docker start seafile).

matthiss
2 years ago

Hi jensearat,
thank you so much for your work!
I'm currently learning about docker and seafile. I followed your instructions, but can't figure out how to run seafile again after exiting the container.

FATA[0000] Error response from daemon: Conflict. The name "seafile" is already in use by container d7fddaaf1fb2. You have to delete (or rename) that container to be able to reuse that name.

Do you have any ideas?