diff --git a/manual/deploy/README.md b/manual/deploy/README.md index 47ad267f..e414f594 100644 --- a/manual/deploy/README.md +++ b/manual/deploy/README.md @@ -12,7 +12,7 @@ In production environment we recommend using MySQL as the database and config Se We provide three ways to deploy Seafile services: -* Using [Docker](deploy_with_docker.md) +* Using [Docker](../docker/deploy_seafile_with_docker.md) * Using [installation script](https://github.com/haiwen/seafile-server-installer) * Manually installing Seafile and setting up database, memcached and Nginx/Apache. See the following section. diff --git a/manual/deploy/deploy_with_docker.md b/manual/deploy/deploy_with_docker.md deleted file mode 100644 index 5db619a3..00000000 --- a/manual/deploy/deploy_with_docker.md +++ /dev/null @@ -1,244 +0,0 @@ -## About - -* [Docker](https://docker.com/) is an open source project to pack, ship and run any Linux application in a lighter weight, faster container than a traditional virtual machine. -* Docker makes it much easier to deploy [a Seafile server](https://github.com/haiwen/seafile) on your servers and keep it updated. -* The base image configures Seafile with the Seafile team's recommended optimal defaults. - -If you are not familiar with docker commands, please refer to [docker documentation](https://docs.docker.com/engine/reference/commandline/cli/). - -**Note**: If you want to deploy the Seafile Pro Edition with docker, refor to the [Deploying Seafile-pro with Docker](../deploy_pro/deploy_with_docker.md) - -## For seafile 7.x.x or newer - -Starting with 7.0, we have adjusted seafile-docker image to use multiple containers. The old image runs MariaDB-Server and Memcached in the same container with Seafile server. Now, we strip the MariaDB-Server and Memcached services from the Seafile image and run them in their respective containers. - -If you plan to deploy seafile 7.0 or newer version, you should refer to the [Deploy Documentation](<../docker/deploy seafile with docker.md>). - -If you plan to upgrade 6.3 to 7.0, you can refer to the [Upgrade Documentation](<../docker/6.3 upgrade to 7.0.md>). - -## For seafile 6.x.x - -### Getting started - -To run the seafile server container: - -```sh -docker run -d --name seafile \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - seafileltd/seafile:latest - -``` - -Wait for a few minutes for the first time initialization, then visit `http://seafile.example.com` to open Seafile Web UI. - -This command will mount folder `/opt/seafile-data` at the local server to the docker instance. You can find logs and other data under this folder. - -### More configuration options - -#### Custom admin username and password - -The default admin account is `me@example.com` and the password is `asecret`. You can use a different password by setting the container's environment variables: -e.g. - -```sh -docker run -d --name seafile \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -e SEAFILE_ADMIN_EMAIL=me@example.com \ - -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - seafileltd/seafile:latest - -``` - -If you forget the admin password, you can add a new admin account and then go to the sysadmin panel to reset user password. - -#### Let's encrypt SSL certificate - -If you set `SEAFILE_SERVER_LETSENCRYPT` to `true`, the container would request a letsencrypt-signed SSL certificate for you automatically. - -e.g. - -``` -docker run -d --name seafile \ - -e SEAFILE_SERVER_LETSENCRYPT=true \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -e SEAFILE_ADMIN_EMAIL=me@example.com \ - -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - -p 443:443 \ - seafileltd/seafile:latest - -``` - -If you want to use your own SSL certificate: - -* create a folder `/opt/seafile-data/ssl`, and put your certificate and private key under the ssl directory. -* Assume your site name is `seafile.example.com`, then your certificate must have the name `seafile.example.com.crt`, and the private key must have the name `seafile.example.com.key`. - -#### Modify seafile server configurations - -The config files are under `shared/seafile/conf`. You can modify the configurations according to[ Seafile manual](https://download.seafile.com/published/seafile-manual/home.md) - -After modification, you need to restart the container: - -``` -docker restart seafile - -``` - -#### Find logs - -The seafile logs are under `shared/logs/seafile` in the docker, or `/opt/seafile-data/logs/seafile` in the server that run the docker. - -The system logs are under `shared/logs/var-log`, or `/opt/seafile-data/logs/var-log` in the server that run the docker. - -#### Add a new admin - -Ensure the container is running, then enter this command: - -``` -docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh - -``` - -Enter the username and password according to the prompts. You now have a new admin account. - -### Directory structure - -#### `/shared` - -Placeholder spot for shared volumes. You may elect to store certain persistent information outside of a container, in our case we keep various logfiles and upload directory outside. This allows you to rebuild containers easily without losing important information. - -* /shared/db: This is the data directory for mysql server -* /shared/seafile: This is the directory for seafile server configuration and data. -* /shared/logs: This is the directory for logs. - * /shared/logs/var-log: This is the directory that would be mounted as `/var/log` inside the container. For example, you can find the nginx logs in `shared/logs/var-log/nginx/`. - * /shared/logs/seafile: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in `shared/logs/seafile/seafile.log`. -* /shared/ssl: This is directory for certificate, which does not exist by default. -* /shared/bootstrap.conf: This file does not exist by default. You can create it by your self, and write the configuration of files similar to the `samples` folder. - -### Upgrading seafile server - -If you plan to upgrade 6.3 to 7.0, you can refer to the [Upgrade Documentation](<../docker/6.3 upgrade to 7.0.md>). - -To upgrade to the latest version of seafile 6.3: - -```sh -docker pull seafileltd/seafile:latest -docker rm -f seafile -docker run -d --name seafile \ - -e SEAFILE_SERVER_LETSENCRYPT=true \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -e SEAFILE_ADMIN_EMAIL=me@example.com \ - -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - -p 443:443 \ - seafileltd/seafile:latest - -``` - -If you are one of the early users who use the `launcher` script, you should refer to [upgrade from old format](https://github.com/haiwen/seafile-docker/blob/master/upgrade_from_old_format.md) document. - -### Backup and recovery - -#### Struct - -We assume your seafile volumns path is in `/shared`. And you want to backup to `/backup` directory. -You can create a layout similar to the following in /backup directory: - -```struct -/backup ----- databases/ contains database backup files ----- data/ contains backups of the data directory - -``` - -The data files to be backed up: - -```struct -/shared/seafile/conf # configuration files -/shared/seafile/pro-data # data of es -/shared/seafile/seafile-data # data of seafile -/shared/seafile/seahub-data # data of seahub - -``` - -#### Backup - -Steps: - -1. Backup the databases; -2. Backup the seafile data directory; - -[Backup Order: Database First or Data Directory First](../maintain/backup_recovery.md) - -* backing up Database: - - ```bash - # It's recommended to backup the database to a separate file each time. Don't overwrite older database backups for at least a week. - cd /backup/databases - docker exec -it seafile mysqldump -uroot --opt ccnet_db > ccnet_db.sql - docker exec -it seafile mysqldump -uroot --opt seafile_db > seafile_db.sql - docker exec -it seafile mysqldump -uroot --opt seahub_db > seahub_db.sql - - ``` - -* Backing up Seafile library data: - * To directly copy the whole data directory - - ```bash - cp -R /shared/seafile /backup/data/ - cd /backup/data && rm -rf ccnet - - ``` - - * Use rsync to do incremental backup - - ```bash - rsync -az /shared/seafile /backup/data/ - cd /backup/data && rm -rf ccnet - - ``` - -### Recovery - -* Restore the databases: - - ```bash - cp /backup/data/ccnet_db.sql /shared/ccnet_db.sql - cp /backup/data/seafile_db.sql /shared/seafile_db.sql - cp /backup/data/seahub_db.sql /shared/seahub_db.sql - docker exec -it seafile /bin/sh -c "mysql -uroot ccnet_db < /shared/ccnet_db.sql" - docker exec -it seafile /bin/sh -c "mysql -uroot seafile_db < /shared/seafile_db.sql" - docker exec -it seafile /bin/sh -c "mysql -uroot seahub_db < /shared/seahub_db.sql" - - ``` - -* Restore the seafile data: - - ```bash - cp -R /backup/data/* /shared/seafile/ - - ``` - -### Garbage collection - -When files are deleted, the blocks comprising those files are not immediately removed as there may be other files that reference those blocks (due to the magic of deduplication). To remove them, Seafile requires a '[garbage collection](../maintain/seafile_gc.md)' process to be run, which detects which blocks no longer used and purges them. (NOTE: for technical reasons, the GC process does not guarantee that _every single_ orphan block will be deleted.) - -The required scripts can be found in the `/scripts` folder of the docker container. To perform garbage collection, simply run `docker exec seafile /scripts/gc.sh`. For the community edition, this process will stop the seafile server, but it is a relatively quick process and the seafile server will start automatically once the process has finished. The Professional supports an online garbage collection. - -### Troubleshooting - -You can run docker commands like "docker exec" to find errors. - -```sh -docker exec -it seafile bash - -``` - - diff --git a/manual/deploy_pro/README.md b/manual/deploy_pro/README.md index 4839882d..08f53a88 100644 --- a/manual/deploy_pro/README.md +++ b/manual/deploy_pro/README.md @@ -3,7 +3,7 @@ Install Seafile Pro Edition -- Method 1: [Deploy Seafile with Docker](deploy_with_docker.md) +- Method 1: [Deploy Seafile with Docker](../docker/pro-edition/deploy_seafile_pro_with_docker.md) - Method 2 (For Debian and CentOS 7): [Deploy Seafile with an installation script](https://github.com/haiwen/seafile-server-installer#auto-install-seafile-server-ce-and-pro). The installer offer a quick and easy way to set up a production ready Seafile Server using MariaDB, Memcached and NGINX as a reverse proxy in under 5 minutes. - Method 3: [Download and Setup Seafile Professional Server Step by Step](download_and_setup_seafile_professional_server.md) diff --git a/manual/deploy_pro/deploy_with_docker.md b/manual/deploy_pro/deploy_with_docker.md deleted file mode 100644 index edee27c9..00000000 --- a/manual/deploy_pro/deploy_with_docker.md +++ /dev/null @@ -1,261 +0,0 @@ -## About - -* [Docker](https://docker.com/) is an open source project to pack, ship and run any Linux application in a lighter weight, faster container than a traditional virtual machine. -* Docker makes it much easier to deploy [a Seafile server](https://github.com/haiwen/seafile) on your servers and keep it updated. -* The base image configures Seafile with the Seafile team's recommended optimal defaults. - -If you are not familiar with docker commands, please refer to [docker documentation](https://docs.docker.com/engine/reference/commandline/cli/). - -## For seafile 7.x.x - -Starting with 7.0, we have adjusted seafile-docker image to use multiple containers. The old image runs MariaDB-Server、Memcached and Elasticsearch in the same container with Seafile server. Now, we strip the MariaDB-Server、Memcached and Elasticsearch from the Seafile image and run them in their respective containers. - -If you plan to deploy seafile 7.0, you should refer to the [Deploy Documentation](<../docker/pro-edition/Deploy Seafile-pro with Docker.md>). - -If you plan to upgrade 6.3 to 7.0, you can refer to the [Upgrade Documentation](<../docker/pro-edition/6.3 upgrade to 7.0.md>). - -## For seafile 6.x.x - -### Getting Started - -Login the Seafile private registry: - -```sh -docker login {host} - -``` - -You can find the private registry information on the [customer center download page](https://customer.seafile.com/downloads/) - -To run the seafile server container: - -```sh -docker run -d --name seafile \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - {host}/seafileltd/seafile-pro:latest - -``` - -Wait for a few minutes for the first time initialization, then visit `http://seafile.example.com` to open Seafile Web UI. - -This command will mount folder `/opt/seafile-data` at the local server to the docker instance. You can find logs and other data under this folder. - -### Put your licence file - -If you have a `seafile-license.txt` licence file, simply put it in the folder `/opt/seafile-data/seafile/`. In your host machine: - -```sh -mkdir -p /opt/seafile-data/seafile/ -cp /path/to/seafile-license.txt /opt/seafile-data/seafile/ - -``` - -Then restart the container. - -```sh -docker restart seafile - -``` - -### More configuration Options - -#### Custom Admin Username and Password - -The default admin account is `me@example.com` and the password is `asecret`. You can use a different password by setting the container's environment variables: -e.g. - -```sh -docker run -d --name seafile \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -e SEAFILE_ADMIN_EMAIL=me@example.com \ - -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - {host}/seafileltd/seafile-pro:latest - -``` - -If you forget the admin password, you can add a new admin account and then go to the sysadmin panel to reset user password. - -#### Let's encrypt SSL certificate - -If you set `SEAFILE_SERVER_LETSENCRYPT` to `true`, the container would request a letsencrypt-signed SSL certificate for you automatically. - -e.g. - -```sh -docker run -d --name seafile \ - -e SEAFILE_SERVER_LETSENCRYPT=true \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -e SEAFILE_ADMIN_EMAIL=me@example.com \ - -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - -p 443:443 \ - {host}/seafileltd/seafile-pro:latest - -``` - -If you want to use your own SSL certificate: - -* create a folder `/opt/seafile-data/ssl`, and put your certificate and private key under the ssl directory. -* Assume your site name is `seafile.example.com`, then your certificate must have the name `seafile.example.com.crt`, and the private key must have the name `seafile.example.com.key`. - -#### Modify Seafile Server Configurations - -The config files are under `shared/seafile/conf`. You can modify the configurations according to [Seafile manual](https://download.seafile.com/published/seafile-manual/home.md) - -After modification, you need to restart the container: - -```sh -docker restart seafile - -``` - -#### Find logs - -The seafile logs are under `/shared/logs/seafile` in the docker, or `/opt/seafile-data/logs/seafile` in the server that run the docker. - -The system logs are under `/shared/logs/var-log`, or `/opt/seafile-data/logs/var-log` in the server that run the docker. - -#### Add a new Admin - -Ensure the container is running, then enter this command: - -```sh -docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh - -``` - -Enter the username and password according to the prompts. You now have a new admin account. - -### Directory Structure - -#### `/shared` - -Placeholder spot for shared volumes. You may elect to store certain persistent information outside of a container, in our case we keep various logfiles and upload directory outside. This allows you to rebuild containers easily without losing important information. - -* /shared/db: This is the data directory for mysql server -* /shared/seafile: This is the directory for seafile server configuration and data. -* /shared/logs: This is the directory for logs. - * /shared/logs/var-log: This is the directory that would be mounted as `/var/log` inside the container. For example, you can find the nginx logs in `shared/logs/var-log/nginx/`. - * /shared/logs/seafile: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in `shared/logs/seafile/seafile.log`. -* /shared/ssl: This is directory for certificate, which does not exist by default. - -### Upgrading Seafile Server - -If you plan to upgrade 6.3 to 7.0, you can refer to the [Upgrade Documentation](<../docker/pro-edition/6.3 upgrade to 7.0.md>). - -To upgrade to the latest version of seafile 6.3: - -```sh -docker pull {host}/seafileltd/seafile-pro:latest -docker rm -f seafile -docker run -d --name seafile \ - -e SEAFILE_SERVER_LETSENCRYPT=true \ - -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \ - -e SEAFILE_ADMIN_EMAIL=me@example.com \ - -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \ - -v /opt/seafile-data:/shared \ - -p 80:80 \ - -p 443:443 \ - {host}/seafileltd/seafile-pro:latest - -``` - -If you are one of the early users who use the `launcher` script, you should refer to [upgrade from old format](https://github.com/haiwen/seafile-docker/blob/master/upgrade_from_old_format.md) document. - -### Backup and Recovery - -#### Struct - -We assume your seafile volumns path is in `/shared`. And you want to backup to `/backup` directory. -You can create a layout similar to the following in /backup directory: - -```struct -/backup ----- databases/ contains database backup files ----- data/ contains backups of the data directory - -``` - -The data files to be backed up: - -```struct -/shared/seafile/conf # configuration files -/shared/seafile/pro-data # data of es -/shared/seafile/seafile-data # data of seafile -/shared/seafile/seahub-data # data of seahub - -``` - -#### Backup - -Steps: - -1. Backup the databases; -2. Backup the seafile data directory; - -[Backup Order: Database First or Data Directory First](../maintain/backup_recovery.md) - -* backing up Database: - - ```bash - # It's recommended to backup the database to a separate file each time. Don't overwrite older database backups for at least a week. - cd /backup/databases - docker exec -it seafile mysqldump -uroot --opt ccnet_db > ccnet_db.sql - docker exec -it seafile mysqldump -uroot --opt seafile_db > seafile_db.sql - docker exec -it seafile mysqldump -uroot --opt seahub_db > seahub_db.sql - - ``` - -* Backing up Seafile library data: - * To directly copy the whole data directory - - ```bash - cp -R /shared/seafile /backup/data/ - cd /backup/data && rm -rf ccnet - - ``` - - * Use rsync to do incremental backup - - ```bash - rsync -az /shared/seafile /backup/data/ - cd /backup/data && rm -rf ccnet - - ``` - -#### Recovery - -* Restore the databases: - - ```bash - cp /backup/data/ccnet_db.sql /shared/ccnet_db.sql - cp /backup/data/seafile_db.sql /shared/seafile_db.sql - cp /backup/data/seahub_db.sql /shared/seahub_db.sql - docker exec -it seafile /bin/sh -c "mysql -uroot ccnet_db < /shared/ccnet_db.sql" - docker exec -it seafile /bin/sh -c "mysql -uroot seafile_db < /shared/seafile_db.sql" - docker exec -it seafile /bin/sh -c "mysql -uroot seahub_db < /shared/seahub_db.sql" - - ``` - -* Restore the seafile data: - - ```bash - cp -R /backup/data/* /shared/seafile/ - - ``` - -### Troubleshooting - -You can run docker commands like "docker exec" to find errors. - -```sh -docker exec -it seafile /bin/bash - -``` - - diff --git a/manual/docker/6.3 upgrade to 7.0.md b/manual/docker/6.3_upgrade_to_7.0.md similarity index 100% rename from manual/docker/6.3 upgrade to 7.0.md rename to manual/docker/6.3_upgrade_to_7.0.md diff --git a/manual/docker/deploy seafile with docker.md b/manual/docker/deploy_seafile_with_docker.md similarity index 100% rename from manual/docker/deploy seafile with docker.md rename to manual/docker/deploy_seafile_with_docker.md diff --git a/manual/docker/pro-edition/6.3 upgrade to 7.0.md b/manual/docker/pro-edition/6.3_upgrade_to_7.0.md similarity index 100% rename from manual/docker/pro-edition/6.3 upgrade to 7.0.md rename to manual/docker/pro-edition/6.3_upgrade_to_7.0.md diff --git a/manual/docker/pro-edition/Deploy Seafile-pro with Docker.md b/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md similarity index 100% rename from manual/docker/pro-edition/Deploy Seafile-pro with Docker.md rename to manual/docker/pro-edition/deploy_seafile_pro_with_docker.md diff --git a/manual/docker/pro-edition/Migrate CE to Pro with Docker.md b/manual/docker/pro-edition/migrate_ce_to_pro_with_docker.md similarity index 100% rename from manual/docker/pro-edition/Migrate CE to Pro with Docker.md rename to manual/docker/pro-edition/migrate_ce_to_pro_with_docker.md diff --git a/mkdocs.yml b/mkdocs.yml index 4e8ccad2..5662a33c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -55,7 +55,6 @@ nav: - Forward: deploy/README.md - Deploy with SQLite: deploy/using_sqlite.md - Deploy with MySQL: deploy/using_mysql.md - - Deploy with Docker: deploy/deploy_with_docker.md - Config Seahub with Nginx: deploy/deploy_with_nginx.md - Enabling Https with Nginx: deploy/https_with_nginx.md - Config Seahub with Apache: deploy/deploy_with_apache.md @@ -84,7 +83,6 @@ nav: - Deploy Seafile Pro Edition: - Forward: deploy_pro/README.md - Download and Setup Seafile Professional Server: deploy_pro/download_and_setup_seafile_professional_server.md - - Deploy Seafile-pro with Docker: deploy_pro/deploy_with_docker.md - Migrate from Seafile Community Server: deploy_pro/migrate_from_seafile_community_server.md - Upgrading Seafile Professional Server: deploy_pro/upgrading_seafile_professional_server.md - LDAP/AD Integration: @@ -125,12 +123,12 @@ nav: - Import Directory To Seafile: deploy_pro/seaf_import.md - License: deploy_pro/seafile_professional_sdition_software_license_agreement.md - Deploy Seafile with Docker: - - Deploy Seafile with Docker: docker/deploy seafile with docker.md - - Deploy Seafile Pro Edition with Docker: docker/pro-edition/Deploy Seafile-pro with Docker.md - - Migrate CE to Pro with Docker: docker/pro-edition/Migrate CE to Pro with Docker.md + - Deploy Seafile with Docker: docker/deploy_seafile_with_docker.md + - Deploy Seafile Pro Edition with Docker: docker/pro-edition/deploy_seafile_pro_with_docker.md + - Migrate CE to Pro with Docker: docker/pro-edition/migrate_ce_to_pro_with_docker.md - Upgrade from 6.3 to 7.0: - - Upgrade Seafile Docker CE: docker/6.3 upgrade to 7.0.md - - Upgrade Seafile Docker Pro: docker/pro-edition/6.3 upgrade to 7.0.md + - Upgrade Seafile Docker CE: docker/6.3_upgrade_to_7.0.md + - Upgrade Seafile Docker Pro: docker/pro-edition/6.3_upgrade_to_7.0.md - Upgrade for other versions: docker/upgrade/upgrade_docker.md - Configuration and Customization: - Forward: config/README.md