Seafile container with auto setup and update
2.8K
Easy usable docker image for Seafile.
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.
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.
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).
| Variable | Usage | Target |
|---|---|---|
| SEAFILE_VERSION | The seafile server version you want to use. If not specified 6.0.5 is used. Mandatory for upgrade | init + upgrade |
| SEAFILE_ADMIN_EMAIL | The 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_PASSWORD | The admin password. There is a default value, but I won't document it to make sure you won't use it. | init |
| SEAFILE_HOST | The 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_PORT | The 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_HTTPS | 1 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_URL | The 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_DN | The ldap user dn configuration value (see seafile manual for details) | init |
| SEAFILE_LDAP_BASE | The ldap base configuration value (see seafile manual for details) | init |
| SEAFILE_LDAP_PASSWORD | The ldap password configuration value (see seafile manual for details) | init |
| SEAFILE_LDAP_LOGIN_ATTR | The ldap login attr configuration value (see seafile manual for details) | init |
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 is easy with this image.
docker stop seafile; docker rm -f -v seafile)/this/will/be/your/data/path in this page) :warning:SEAFILE_VERSION. It's always mandatory for upgrade while it's not for init.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.
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:
docker stop seafile; docker rm -f -v seafile)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
The source of the project is located on GitLab: docker-seafile
If you like this project, please donate. You can send coins to the following addresses.
Bitcoin: 3As97ekGTUeMUtbou3AXqikgSbWD9wjPrX
Litecoin: MHaqGAqMoQGiTkNyg7w8haC6mU25Frgi3M
Content type
Image
Digest
Size
505.6 MB
Last updated
about 4 years ago
docker pull plaguedr/seafile