This Dockerfile installs latest Seafile with HTTPS (TLS) enabled by default.
806
This Dockerfile installs latest Seafile with HTTPS (TLS) enabled by default.
Idea and initial Dockerfile was based on https://github.com/alvistar/seafile-docker
Note: If you want to use a stable version, use coeusite/docker-seafile:phusion instead.
The image contains/adds the following:
For running Seafile within Docker, three containers are needed, namely:
Having different containers is nice if you need/want to upgrade and/or backup your installation.
Create a custom bridge network
docker network create --subnet=172.31.39.0/24 nginx-proxy
Create the MariaDB(()MySQL) database container by running:
docker volume create --name seafile-dbstore
docker run -d -p 127.0.0.1:3306:3306 \
--network nginx-proxy --ip 172.31.39.98 \
-v seafile-dbstore:/var/lib/mysql:rw \
-e MYSQL_ROOT_PASSWORD=<password> \
-e MYSQL_DATABASE=seafile \
-e MYSQL_USER=seafile \
-e MYSQL_PASSWORD=<password> \
--name seafile-db mariadb:latest
This will create the needed container, based on mariadb. This also assumes that you're not yet running another database at port 3306 on your host. In case you do, e.g. use
-p 127.0.0.1:33306:3306
to expose the database' internal port 3306 to localhost:33306 on your host.
As we need the IP of your database container later, look it up by doing a:
docker inspect "seafile-db" | grep IPAddress | cut -d '"' -f 4
It should be 172.31.39.98 if you are following instructions above.
Note: IPv6 support is not implemented in this Dockerfile yet!
Now, create the actual Seafile volume (for storing the actual data), using:
docker run -it --dns=127.0.0.1 \
--network nginx-proxy --ip 172.31.39.99 \
-e SEAFILE_DOMAIN_NAME=<YOUR.HOST.NAME> \
--name seafile-data coeusite/docker-seafile:latest bootstrap
Note: If you wanna upgrade your container, login to you container by
docker exec -it seafile /bin/bash
and follow instructions on https://manual.seafile.com/deploy/upgrade.html !!!
Note: The <yourdomain.tld> should either point to a IP or valid domain you want to run Seafile on. If you're running Docker on your localhost you simply can specify 127.0.0.1.
Bonus: If you want to specify a different port than 8080, add the parameter
SEAFILE_DOMAIN_PORT=<yourport>
to the command line above. Don't forget to change the port at the final command later on though!
The script which now runs will ask a few questions to correctly set up all the things for you, in particular:
"What is the name of the server?"
Hint: Enter the name (not a domain or IP!) of this Seafile installation.
"What is the ip or domain of the server?"
Hint: If you're running Docker on your local PC, enter 127.0.0.1 -- otherwise enter the IP or domain of your server you're running Docker on.
"What is the host of mysql server?"
Hint: Enter the IP of your seafile-db container, e.g. 172.31.39.98. Remember the step from above?
Important: For all other questions just accept the defaults by pressing [ENTER].
Almost done! Now actually run Seafile using the database and the volume with:
docker run -d -t --dns=127.0.0.1 -p 127.0.0.1:8080:8080 \
--network nginx-proxy --ip 172.31.39.99 \
--volumes-from seafile-data \
-e SEAFILE_DOMAIN_NAME=<YOUR.HOST.NAME> \
--name seafile coeusite/docker-seafile
Remember to configure your firewall properly, e.g. for firewalld:
firewall-cmd --add-port=8080/tcp --permanent && firewall-cmd --reload
Seafile should now be running on your host at
https://<yourhost>:8080
Congrats, you're now running Seafile using your self-signed certificate!
You can specify a custom certificate instead of using a self-signed one by following steps:
-v /opt/lets-encrypt:/etc/nginx/certs:ro, e.g.docker run -d -t --dns=127.0.0.1 -p 127.0.0.1:8080:8080 \
--network nginx-proxy --ip 172.31.39.99 \
--volumes-from seafile-data \
-v /opt/lets-encrypt:/etc/nginx/certs:ro \
-e SEAFILE_DOMAIN_NAME=<YOUR.HOST.NAME> \
--name seafile coeusite/docker-seafile
Because Seafile requires an initialization process (bootstrap), I do think using compose is not a good idea.
docker-seafile can work pretty well with jwilder's nginx-proxy and jrcs's letsencrypt-nginx-proxy-companion. You may check this page for details (Chinese ONLY): https://coeusite.github.io/2016/09/27/Docker-Containers-on-My-Dedibox.html
Content type
Image
Digest
Size
155.5 MB
Last updated
over 8 years ago
docker pull coeusite/docker-seafile:6.2.5-ce