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, Metadata Server, Thumbnail Server and Seafile AI extension are omitted
- Seafile Notification Server is included
- OnlyOffice Document Server is included
- Compatible with previous deployments of
h44z/seafile-cecontainers
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 .envMandatory 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
httporhttps - INIT_SEAFILE_ADMIN_EMAIL: E-mail address of the Seafile admin
- INIT_SEAFILE_ADMIN_PASSWORD: Password of the Seafile admin
- REDIS_PASSWORD: Password for the Redis cache
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.confCustom 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 dashboardIn Seafile 13, a few more configuration options and services were added. For most new values, the defaults should be sufficient.
The only option that should manually be set in the .env file is REDIS_PASSWORD.
SEAFILE_IMAGE_VERSIONwas replaced withSEAFILE_IMAGE.SEAFILE_IMAGEnow contains the whole image path, not just the version.- The Seafile notification server has been added. It is enabled with the
ENABLE_NOTIFICATION_SERVERconfiguration option. The image can be specified using theNOTIFICATION_SERVER_IMAGEoption. - Memcached was replaced with Redis. Therefore, the following new configuration options can be set:
CACHE_PROVIDER,REDIS_HOST,REDIS_PORT,REDIS_PASSWORD. The most important option isREDIS_PASSWORD, specify a secure password here.
As documented in the official upgrade guidelines, you should also clean up old configuration values in seafile.conf and seahub_settings.py.
- backup old files:
# please replace ./data to your $SEAFILE_SHARED_DATA
cp ./data/seafile/conf/seafile.conf ./data/seafile/conf/seafile.conf.bak_v12
cp ./data/seafile/conf/seahub_settings.py ./data/seafile/conf/seahub_settings.py.bak_v12- Clean up redundant configuration items in the configuration files:
Open ./data/seafile/conf/seafile.conf and remove the entire [memcached], [database], [commit_object_backend], [fs_object_backend], [notification] and [block_backend] if above sections have correctly specified in .env.
Open ./data/seafile/conf/seahub_settings.py and remove the entire blocks for DATABASES = {...} and CACHES = {...}.
In the most cases, the seafile.conf then only include the listen port 8082 of Seafile file server.
Seafile 11.x used different Docker Images. Thus it is important to adapt the configuration variables in your .env file accordingly:
MYSQL_SERVERis nowDB_HOSTMYSQL_USERis nowDB_USERMYSQL_USER_PASSWORDis nowDB_PASSWORDMYSQL_PORTis nowDB_PORTMYSQL_ROOT_PASSWORDis nowDB_ROOT_PASSWDSEAFILE_VERSIONis nowSEAFILE_IMAGE_VERSION(This is a very important change - Seafile does not start correctly with the old parameter!)SEAFILE_NAMEis removedSEAFILE_ADDRESSis now a combination ofSEAFILE_SERVER_PROTOCOLandSEAFILE_SERVER_HOSTNAMESEAFILE_ADMINis nowINIT_SEAFILE_ADMIN_EMAILSEAFILE_ADMIN_PWis nowINIT_SEAFILE_ADMIN_PASSWORDLDAP_IGNORE_CERT_CHECKis removedMODEis 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
/sharedto/seafile. - The file holding the current seafile version now lives in
/seafile/current_versioninstead 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