Sign inSign up

plaguedr/seafile

By plaguedr

•Updated about 4 years ago

Seafile container with auto setup and update

Image
3

2.8K

plaguedr/seafile repository overview

⁠Seafile Docker image

Easy usable docker image for Seafile⁠.

⁠Project will be abandon

This project will most likely be abandon soon, as I started to develop the Docker Image for Seafile-Pro.

It can be found here: seafile-pro⁠

I strongly suggest to start using the Seafile-Pro.

⁠Concept

The goal of this image: to create a seafile docker image that can be used without the need to run configurations scripts manually or to tweek configurations files. Most of configuration values can be passed to the first docker run command with configuration variables.

⁠Features:
  • integrated nginx
  • support for webdav
  • automatic installation
  • automatic upgrade (there might be a dragon, backup before, backup after. You've been warned.)
⁠How to use

Choose a data path on your server.

sudo mkdir -p /this/will/be/your/data/path

Run the docker container

sudo docker \
  run \
  -d \
  -e "SEAFILE_VERSION=6.0.5" \
  -e "[email protected]" \
  -e "SEAFILE_ADMIN_PASSWORD=password" \
  -e "SEAFILE_HOST=this.ismyhost.com" \
  -e "SEAFILE_PORT=80" \
  -v "/this/will/be/your/data/path:/opt/seafile" \
  -p 80:80 \
  --name="seafile" \
  plaguedr/seafile

And that's it.

The first time, the data path will be filled with everything that needs to be done to have a working seafile server with an admin whose email adress is [email protected] and whose passord is password.

While this is the fastest way to init & start a seafile server, the "(Init) + (classic run) usage" is prefered (see corresponding section below).

⁠Configuration
VariableUsageTarget
SEAFILE_VERSIONThe seafile server version you want to use. If not specified 6.0.5 is used. Mandatory for upgradeinit + upgrade
SEAFILE_ADMIN_EMAILThe admin email (that is the login on seafile server). There is a default value, but I won't document it to make sure you won't use it.init
SEAFILE_ADMIN_PASSWORDThe admin password. There is a default value, but I won't document it to make sure you won't use it.init
SEAFILE_HOSTThe host as seen from internet (or from the users). If you use a complex system of vhosts and reverse proxies in front of that image, this is the hostname configured in you vhost configuration that may be different than the one where you run your docker image.init
SEAFILE_PORTThe port as seen from internet (or from the users). If you use a complex system of vhosts and reverse proxies in front of that image, this is the port configured in you vhost configuration that my be different than the one you bind on your docker command. Default value is empty which will be considered as defaut port (80 for http, 443 for https, see SEAFILE_USE_HTTPS for https)init
SEAFILE_USE_HTTPS1 if the protocol as seen from the internet (or from the users) is https. That image only provide http as output, but you may use it through nginx/apache reverse proxy and provide https encryption through that layer. If you do so, define that variable to "1".init
SEAFILE_LDAP_URLThe ldap url if you're using a ldap server to identify accounts. (if set an not empty, an ldap section will be created in the configuration files, and a ldap server will be used. If you don't know what a ldap server is, don't specify that variable)init
SEAFILE_LDAP_USER_DNThe ldap user dn configuration value (see seafile manual for details)init
SEAFILE_LDAP_BASEThe ldap base configuration value (see seafile manual for details)init
SEAFILE_LDAP_PASSWORDThe ldap password configuration value (see seafile manual for details)init
SEAFILE_LDAP_LOGIN_ATTRThe ldap login attr configuration value (see seafile manual for details)init
⁠(Init) + (classic run) usage

The usage presented in the "Easy usage" section need to provide configuration values on each run, while it's only needed on the first run. If you're bothered by that you can do:

sudo docker run \
  -it \
  --rm=true \
  -e "SEAFILE_VERSION=6.0.5" \
  -e "[email protected]" \
  -e "SEAFILE_ADMIN_PASSWORD=password" \
  -e "SEAFILE_HOST=this.ismyhost.com" \
  -e "SEAFILE_PORT=80" \
  -v "/this/will/be/your/data/path:/opt/seafile" \
  --name="seafile-init" \
  plaguedr/seafile \
  /init

It will create everything needed interactively. When the command ends, everything is ready.

And then, you can use for each further starts :

sudo docker run \
  -d \
  -v "/this/will/be/your/data/path:/opt/seafile" \
  -p 80:80 \
  --name="seafile" \
  plaguedr/seafile
⁠Upgrading

Upgrading is easy with this image.

  1. Stop the seafile server (eg: docker stop seafile; docker rm -f -v seafile)
  2. :warning: backup you data folder (/this/will/be/your/data/path in this page) :warning:
  3. Run the upgrade command (see below) and don't forget to specify SEAFILE_VERSION. It's always mandatory for upgrade while it's not for init.
  4. Run again the seafile server (like you usually do, see the previous section)

The upgrade command:

sudo docker run \
  -it \
  --rm=true \
  -e "SEAFILE_VERSION=6.0.5" \
  --name="seafile-upgrade" \
  -v "/this/will/be/your/data/path:/opt/seafile" \
  plaguedr/seafile \
  /upgrade

:warning: The upgrade process may ask you things as seafile's upgrade scripts seems to be made to run interactivly.

⁠Launching garbage collector (GC)

As strange as it may look like, seafile doesn't doesn't clean itself it's delete data. You need to explicitely run garbage collection from time to time.

Steps:

  1. Stop the seafile server (eg: docker stop seafile; docker rm -f -v seafile)
  2. (optional) Run the GC tool with "dry run" (see below)
  3. Run the GC tool (see below)
  4. Run again the seafile server (like you usually do, see the section before the previous section)

The GC tool command:

sudo docker run \
  -it \
  --rm=true \
  --name="seafile-clean" \
  -v "/this/will/be/your/data/path:/opt/seafile" \
  plaguedr/seafile \
  /clean

You may want to see if all will be fine without changing anything before really launching the GC tool, so you may just launch it in "dry run" just before:

sudo docker run \
  -it \
  --rm=true \
  --name="seafile-clean" \
  -v "/this/will/be/your/data/path:/opt/seafile" \
  plaguedr/seafile \
  /clean --dry-run
⁠Source

The source of the project is located on GitLab: docker-seafile⁠

⁠Donate

If you like this project, please donate. You can send coins to the following addresses.

Bitcoin: 3As97ekGTUeMUtbou3AXqikgSbWD9wjPrX

Litecoin: MHaqGAqMoQGiTkNyg7w8haC6mU25Frgi3M

Tag summary

Content type

Image

Digest

Size

505.6 MB

Last updated

about 4 years ago

docker pull plaguedr/seafile