Code Monkey home page Code Monkey logo

docker-seafile's Introduction

Docker image for Seafile

This Dockerfile installs latest Seafile with HTTPS (TLS) enabled by default.

Idea and initial Dockerfile was based on https://github.com/alvistar/seafile-docker

Features

The image contains/adds the following:

  • Latest Seafile (4.x)
  • Nginx for TLS (HTTPS) support
  • Self-signed certificates, generated automatically on first run
  • Runit for keeping the services up and running

Changelog

  • 2015/04/18: Added initial support for Seafile 4.x and using the official mysql Docker image. Stay tuned for updates.

Architecture

For running Seafile within Docker, three containers are needed, namely:

  • seafile, which contains the actual Seafile instance running on the server
  • seafile-db, the MySQL database container
  • seafile-data, the data container

Having different containers is nice if you need/want to upgrade and/or backup your installation.

Quickstart

Create the MySQL database container by running:

    docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<password> -e MYSQL_DATABASE=seafile -e MYSQL_USER=seafile -e MYSQL_PASSWORD=<password> --name seafile-db mysql:latest

This will create the needed container, based on mysql. 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 3307:3306

to expose the database' internal port 3306 to 3307 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

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 --link seafile-db:db -e SEAFILE_DOMAIN_NAME=<yourdomain.tld> --name seafile-data x86dev/docker-seafile:latest  bootstrap

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.17.0.2. 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 10001:10001 -p 8082:8082 -p 12001:12001 -p 8080:8080 --volumes-from seafile-data --link seafile-db:db -e SEAFILE_DOMAIN_NAME=<yourdomain.tld> --name seafile x86dev/docker-seafile

Seafile should now be running on your host at

https://<yourhost>:8080

Congrats, you're now running Seafile using your self-signed certificate!

docker-seafile's People

Contributors

x86dev avatar

Watchers

Kosmas Chatzimichalis avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.