This project is going to be archived because of lack of time. There is an official Docker solution as of 2023! https://github.com/haiwen/seafile-docker
Current Seafile server version: 6.2.3
This docker image provides a fully-functional Seafile server installation that is configured with SQLite and has no other dependencies. Internally nginx is configured as a reverse proxy with can either be accessed via HTTP or HTTPs.
- The container exposes a /data volume where all seafile data is stored in a persistent manner
- Initial setup is done during first startup where setup of the administator account is created. The administrator allows to create other users.
- No user interaction needed for container startup!
- Upgrades to new seafile versions are handled internally by automatically running seafile provided upgrade scripts
- Unittests are done using bats
- Automatic Docker builds and Travis builds which run unittests
A bug in earlier container versions led to lost user accounts when the container is re-created (which is done during an update). Libraries still exist and can be used by re-creating the corresponding users. To prevent this to happen run the following command in your container before doing an upgrade from 6.0 containers:
docker exec <CONTAINER-ID> cp -r /seafile/ccnet /data/
docker run -d --name seafile_http \
-p "80:80" \
-e SEAFILE_EXTERNAL_PORT=80 \
-e SEAFILE_HOSTNAME=localhost \
-e SEAFILE_SERVER_NAME=myseafile \
-e SEAFILE_ADMIN_MAIL=admin@seafile.com \
-e SEAFILE_ADMIN_PASSWORD=test123 \
-v "/tmp/seafile_http:/data" \
stonemaster/docker-seafile-server
Create a docker-compose.yml
file:
seafile:
image: stonemaster/docker-seafile-server
container_name: seafile
ports:
- "443:443"
environment:
- SEAFILE_EXTERNAL_PORT=443
- SEAFILE_HOSTNAME=localhost
- SEAFILE_SERVER_NAME=myseafile
- SEAFILE_ADMIN_MAIL=admin@seafile.com
- SEAFILE_ADMIN_PASSWORD=test123
- USE_SSL=on
volumes:
- /tmp/seafile:/data
- ./test/ssl:/etc/ssl
Run docker-compose up -d
.
The following files are located inside the folder
that is mounted to /data
:
seafile_version
seahub-data
seafile-data
seahub.db
seahub-data
contains the internal seafile file structure
and thus the user data. seahub.db
contains the SQLite database
used for meta information by Seafile. seafile_version
is
generated by the container to store the current software
version for seamingless container upgrades. seafile-data
contains the actual user files.
Warning: this is untested!
- Copy the
seahub-data
,seafile-data
andseahub.db
directory/files from the existing installation into your containers to-be-mounteddata
folder. Don't do that when the container is started! - Create a
seafile_version
file in the/data
mount containing the currentMAJOR.MINOR
of your installation e.g.5.0
. Don't add a newline after the version.
To generate a self-signed certificat using OpenSSL use this command:
openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out cert.pem -nodes -days 365
An unprotected private key will be generated using the command
line option -nodes
. Omit it to generate a password protected
private key file. Mount these two files into the container
to the folder /etc/ssl
using the default SSL locations.
Mount your letsencrypt folder to /etc/letsencrypt
. Adapt certificate
and private key filenames using the SSL_CERT_FILE
and SSL_PRIVKEY_FILE
environment variables. It's important that the cert file path points
to fullchain.pem
in order to allow the Seafile client to correctly
verify the certificate.
For example add the following parameters to your docker run
command:
... -v /etc/letsencrypt:/etc/letsencrypt \
-e SSL_CERT_FILE=/etc/letsencrypt/live/seafile.com/fullchain.pem \
-e SSL_PRIVKEY_FILE=/etc/letsencrypt/live/seafile.com/privkey.pem
This port must match the port that is exposed via Docker. It is used internally by Seafile to expose it to the client for file handling.
- default: automatic
- Options:
http
,https
Allows to override the protocol exposed by Seafile file server.
If USE_SSL
is to to on
this is automatically determined
to be https; otherwise it is http. However
if a HTTPs proxy is used in front of the seafile container
this may need to be adapted.
This hostname must match the host the Seafile instance
is running on. This hostname is exposed to clients
to allow file handling. If you get errors during file
uploads and downloads, check that SEAFILE_HOSTNAME
and
SEAFILE_EXTERNAL_PORT
match your setup.
The name of the seafile server instance needed by Seafile.
The administator's e-mail used during initial setup. The administrator is allowed to create other accounts.
The administator's password used during initial setup.
- default:
off
- Options:
on
,off
Enables HTTP (off
) or HTTPs (on
).
Adjust SSL_CERT_FILE
and SSL_PRIVKEY_FILE
environment variables if necessary to match your setup.
- default:
/etc/ssl/cert.pem
The path to the SSL certificate file.
Ignored when USE_SSL
equals off
.
- default:
/etc/ssl/privkey.pem
The path to the SSL private key file.
Ignored when USE_SSL
equals off
.
Boost License. See LICENSE.txt for more details.