Previously, this repository included a comprehensive Docker image for Seafile Server CE 11. It now provides only a docker-compose.yml file to facilitate deployment of the official Seafile Docker containers. The key differences from the official installation method are:
- A single docker-compose.yml file is used
- Traefik replaces Caddy as reverse proxy
- SeaDoc is omitted
- OnlyOffice Document Server is included
- Compatible with previous deployments of
h44z/seafile-ce
containers
Starting from version 12, this repository uses the official Seafile Docker images.
Make sure that you have installed Docker Compose with version 2.30.0 or higher. Setting up Seafile is really easy and can be (or should be) done via Docker Compose.
All important data is stored under /shared
so you should be mounting a volume there (recommended), as shown in the example configurations, or at the respective subdirectories.
The first step is to create a .env
file by copying the provided .env.dist file:
cp .env.dist .env
Mandatory ENV variables for auto setup
- SEAFILE_SERVER_HOSTNAME: Hostname of your Seafile installation, together with SEAFILE_SERVER_PROTOCOL the base-URL is derived
- SEAFILE_SERVER_PROTOCOL: either
http
orhttps
- INIT_SEAFILE_ADMIN_EMAIL: E-mail address of the Seafile admin
- INIT_SEAFILE_ADMIN_PASSWORD: Password of the Seafile admin
If you want to use MySQL/MariaDB, the following variables are needed:
Mandatory ENV variables for MySQL/MariaDB
- DB_HOST: Address of your MySQL server
- DB_USER: MySQL user Seafile should use
- DB_PASSWORD: Password for said MySQL User
- DB_PORT: Port MySQL runs on (Optional, default 3306)
Optional ENV variables for auto setup with MySQL/MariaDB
- MYSQL_USER_HOST: Host the MySQL User is allowed from (default: '%')
- DB_ROOT_PASSWD: If you haven't set up the MySQL tables by yourself, Seafile will do it for you when being provided with the MySQL root password
A sample docker-compose file is provided within this repository.
For a clean install, only office might throw an error (mounting directory onto a file). If that happens ensure that the mount point already exists on the host system (see https://manual.seafile.com/deploy/only_office/ for details):
mkdir -p data/onlyoffice
cp sample-configs/local.json data/onlyoffice/local.conf
Custom settings to Docker containers can be added using a docker-compose.override.yml
file. For example:
services:
db:
image: mariadb:10.11
environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWD}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_LOG_CONSOLE=true
# - MARIADB_AUTO_UPGRADE=1
volumes:
- ./data/custom_db_backup:/tmp/dbbackup
reverse-proxy:
labels:
- traefik.http.middlewares.dashboard-auth.basicauth.users=admin:$$2y$$05$$HndX02RYOlvwmPCMAXOyVe7VVnICX7czh7heoOYkf3lS/lByMA2hC # overrides the default credentials for the traefik dashboard
Seafile 11.x used different Docker Images. Thus it is important to adapt the configuration variables in your .env
file accordingly:
MYSQL_SERVER
is nowDB_HOST
MYSQL_USER
is nowDB_USER
MYSQL_USER_PASSWORD
is nowDB_PASSWORD
MYSQL_PORT
is nowDB_PORT
MYSQL_ROOT_PASSWORD
is nowDB_ROOT_PASSWD
SEAFILE_VERSION
is nowSEAFILE_IMAGE_VERSION
(This is a very important change - Seafile does not start correctly with the old parameter!)SEAFILE_NAME
is removedSEAFILE_ADDRESS
is now a combination ofSEAFILE_SERVER_PROTOCOL
andSEAFILE_SERVER_HOSTNAME
SEAFILE_ADMIN
is nowINIT_SEAFILE_ADMIN_EMAIL
SEAFILE_ADMIN_PW
is nowINIT_SEAFILE_ADMIN_PASSWORD
LDAP_IGNORE_CERT_CHECK
is removedMODE
is removed
New environment variables were added as well:
JWT_PRIVATE_KEY
: Use the existing token from seafile.conf (jwt_private_key
)ENABLE_SEADOC
: Check official seafile docs, can be kept defaultSEAFILE_LOG_TO_STDOUT
: Check official seafile docs, can be kept defaultNON_ROOT
: Check official seafile docs, can be kept defaultSITE_ROOT
: Check official seafile docs, can be kept default
Besides the adaption of configuration variables, it is also important to move the current_version
file to a new location. Without this step, upgrading Seafile might fail which renders your instance unusable!
mv ./data/seafile/current_version ./data/seafile/seafile-data/current_version
Starting from 11.0.6, this repository uses Traefik v2 as reverse proxy for Seafile and OnlyOffice. Therefore, other reverse proxies like Nginx should be disabled to avoid port binding conflicts.
The .env
configuration must also be updated to include a DOMAINNAME variable which contains the top-level domain name of your Seafile instance. The seafile server will be reachable on the subdomain https://seafile.[DOMAINNAME].
Simply use the newer 11.x.x Docker image. If you used LDAP, please follow the official upgrade instructions and update the settings accordingly.
Simply use the newer 10.x.x Docker image and enable the notification server in your seafile.conf. To enable the notification server, follow the official documentation.
Simply use the newer 9.x.x Docker image.
This version of the image is designed to work with version 9.x.x. The previous version of this Docker image was based on the official Docker image, thus a few changes have to be made in order to upgrade to the new version.
Changes:
- Nginx and Letsencrypt are no longer included in the image.
- The log directory is no longer included in the main directory that can be exported using volumes.
- The path of the main directory changed from
/shared
to/seafile
. - The file holding the current seafile version now lives in
/seafile/current_version
instead of/shared/seafile-data/current_version
. - Many environment variables have been removed in order to keep this image and the setup script simple. Special customizations can still be achived, see here.
Take a look at .env.dist for all available environment variables. Copy .env.dist
to .env
, uncomment and edit the variables as needed.
After the Seafile container has been started at least once, the mounted volume for the /seafile
directory should contain a folder conf
. Take a look at the official manual to check out which settings can be changed.
HINT: After the initial setup (first run), changing the environment variables in .env does not reflect to the configuration files!
You can run docker commands like "docker logs" or "docker exec" to find errors.
docker logs -f seafile
# or
docker exec -it seafile bash