From 02828981b150421f42f64142da2de91344272e47 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 13 Mar 2024 18:11:18 +0800 Subject: [PATCH 1/3] docker deploy in /opt/seafile-data --- manual/docker/deploy_seafile_with_docker.md | 44 ++++++++++--------- .../deploy_seafile_pro_with_docker.md | 42 ++++++++++-------- 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/manual/docker/deploy_seafile_with_docker.md b/manual/docker/deploy_seafile_with_docker.md index 8c93f393..432b20dc 100644 --- a/manual/docker/deploy_seafile_with_docker.md +++ b/manual/docker/deploy_seafile_with_docker.md @@ -2,6 +2,12 @@ ## Getting started +The following assumptions and conventions are used in the rest of this document: + +- `/opt/seafile-data` is the directory of Seafile. If you decide to put Seafile in a different directory - which you can - adjust all paths accordingly. +- Seafile uses two [Docker volumes](https://docs.docker.com/storage/volumes/) for persisting data generated in its database and Seafile Docker container. The volumes' [host paths](https://docs.docker.com/compose/compose-file/compose-file-v3/#volumes) are /opt/seafile-mysql and /opt/seafile-data, respectively. It is not recommended to change these paths. If you do, account for it when following these instructions. +- All configuration and log files for Seafile and the webserver Nginx are stored in the volume of the Seafile container. + ### Install docker Use the [official installation guide for your OS to install Docker](https://docs.docker.com/engine/install/). @@ -27,6 +33,18 @@ Wait for a few minutes for the first time initialization, then visit `http://sea **NOTE: You should run the above command in a directory with the **`docker-compose.yml`**.** +## Seafile directory structure + +### `/opt/seafile-data` + +Placeholder spot for /opt/seafile-data volumes. You may elect to store certain persistent information outside of a container, in our case we keep various log files and upload directory outside. This allows you to rebuild containers easily without losing important information. + +* /opt/seafile-data/seafile: This is the directory for seafile server configuration and data. + * /opt/seafile-data/seafile/logs: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in `/opt/seafile-data/seafile/logs/seafile.log`. +* /opt/seafile-data/logs: This is the directory for logs. + * /opt/seafile-data/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 `/opt/seafile-data/logs/var-log/nginx/`. +* /opt/seafile-data/ssl: This is directory for certificate, which does not exist by default. + ### Find logs To view Seafile docker logs, please use the following command @@ -35,9 +53,9 @@ To view Seafile docker logs, please use the following command docker compose logs -f ``` -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 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. +The system logs are under `/shared/logs/var-log`, or `/opt/seafile-data/logs/var-log` in the server that run the docker. ## More configuration options @@ -74,7 +92,7 @@ seafile: environment: ... - SEAFILE_SERVER_LETSENCRYPT=true - - SEAFILE_SERVER_HOSTNAME=docs.seafile.com + - SEAFILE_SERVER_HOSTNAME=seafile.example.com ... ``` @@ -92,8 +110,8 @@ seafile: ... volumes: ... - - /home/user/your-cert.crt:/shared/ssl/seafile.example.com.crt; - - /home/user/your-key.key:/shared/ssl/seafile.example.com.key; + - /opt/seafile-data/your-cert.crt:/shared/ssl/seafile.example.com.crt; + - /opt/seafile-data/your-key.key:/shared/ssl/seafile.example.com.key; ... ``` @@ -199,20 +217,6 @@ docker compose down docker compose up -d ``` -## Seafile 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 log files and upload directory outside. This allows you to rebuild containers easily without losing important information. - -* /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. - - ## Backup and recovery ### Structure @@ -343,7 +347,7 @@ eg: ```/scripts/ssl.sh /shared/ssl/ example.seafile.com``` If you want to change to https after using http, first backup and move the seafile.nginx.conf. ```sh -mv /opt/seafile/shared/nginx/conf/seafile.nginx.conf /opt/seafile/shared/nginx/conf/seafile.nginx.conf.bak +mv /opt/seafile-data/nginx/conf/seafile.nginx.conf /opt/seafile-data/nginx/conf/seafile.nginx.conf.bak ``` Starting the new container will automatically apply a certificate. diff --git a/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md b/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md index 279ae650..23eb7279 100644 --- a/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md +++ b/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md @@ -9,6 +9,12 @@ Seafile PE can be used without a paid license with up to three users. Licenses f ## Setup +The following assumptions and conventions are used in the rest of this document: + +- `/opt/seafile-data` is the directory of Seafile. If you decide to put Seafile in a different directory - which you can - adjust all paths accordingly. +- Seafile uses two [Docker volumes](https://docs.docker.com/storage/volumes/) for persisting data generated in its database and Seafile Docker container. The volumes' [host paths](https://docs.docker.com/compose/compose-file/compose-file-v3/#volumes) are /opt/seafile-mysql and /opt/seafile-data, respectively. It is not recommended to change these paths. If you do, account for it when following these instructions. +- All configuration and log files for Seafile and the webserver Nginx are stored in the volume of the Seafile container. + ### Installing Docker Use the [official installation guide for your OS to install Docker](https://docs.docker.com/engine/install/). @@ -98,9 +104,9 @@ To view Seafile docker logs, please use the following command docker compose logs -f ``` -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 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. +The system logs are under `/shared/logs/var-log`, or `/opt/seafile-data/logs/var-log` in the server that run the docker. ### Activating the Seafile License @@ -114,6 +120,18 @@ docker compose down docker compose up -d ``` +## Seafile directory structure + +### `/opt/seafile-data` + +Placeholder spot for /opt/seafile-data volumes. You may elect to store certain persistent information outside of a container, in our case we keep various log files and upload directory outside. This allows you to rebuild containers easily without losing important information. + +* /opt/seafile-data/seafile: This is the directory for seafile server configuration 、logs and data. + * /opt/seafile-data/seafile/logs: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in `/opt/seafile-data/seafile/logs/seafile.log`. +* /opt/seafile-data/logs: This is the directory for logs. + * /opt/seafile-data/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 `/opt/seafile-data/logs/var-log/nginx/`. +* /opt/seafile-data/ssl: This is directory for certificate, which does not exist by default. + ### Reviewing the Deployment The command `docker container list` should list the four containers specified in the docker-compose.yml. @@ -289,20 +307,6 @@ docker compose down docker compose up -d ``` -## Seafile 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 log files and upload directory outside. This allows you to rebuild containers easily without losing important information. - -* /shared/seafile: This is the directory for seafile server configuration 、logs and data. - * /shared/seafile/logs: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in `shared/seafile/logs/seafile.log`. -* /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/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. - - ## Backup and Recovery ### Structure @@ -440,7 +444,7 @@ You need to manually add the Clamav config to docker-compose.yml ## FAQ -Q: I forgot the SeaTable admin email address/password, how do I create a new admin account? +Q: I forgot the Seafile admin email address/password, how do I create a new admin account? A: You can create a new admin account by running @@ -448,7 +452,7 @@ A: You can create a new admin account by running docker exec -it seafile /opt/seafile/seafile-server-latest/reset-admin.sh ``` -The SeaTable service must be up when running the superuser command. +The Seafile service must be up when running the superuser command. Q: If, for whatever reason, the installation fails, how do I to start from a clean slate again? @@ -476,7 +480,7 @@ Q: **SEAFILE_SERVER_LETSENCRYPT=false change to true.** A: If you want to change to https after using http, first backup and move the seafile.nginx.conf. ```sh -mv /opt/seafile/shared/nginx/conf/seafile.nginx.conf /opt/seafile/shared/nginx/conf/seafile.nginx.conf.bak +mv /opt/seafile-data/nginx/conf/seafile.nginx.conf /opt/seafile-data/nginx/conf/seafile.nginx.conf.bak ``` Starting the new container will automatically apply a certificate. From 9c438597625cdec5c0f900856e9da05f17ae1db1 Mon Sep 17 00:00:00 2001 From: Daniel Pan Date: Wed, 13 Mar 2024 22:45:42 +0800 Subject: [PATCH 2/3] Update deploy_seafile_pro_with_docker.md --- manual/docker/pro-edition/deploy_seafile_pro_with_docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md b/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md index 23eb7279..1dac5f94 100644 --- a/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md +++ b/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md @@ -128,7 +128,7 @@ Placeholder spot for /opt/seafile-data volumes. You may elect to store certain p * /opt/seafile-data/seafile: This is the directory for seafile server configuration 、logs and data. * /opt/seafile-data/seafile/logs: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in `/opt/seafile-data/seafile/logs/seafile.log`. -* /opt/seafile-data/logs: This is the directory for logs. +* /opt/seafile-data/logs: This is the directory for operating system and Nginx logs. * /opt/seafile-data/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 `/opt/seafile-data/logs/var-log/nginx/`. * /opt/seafile-data/ssl: This is directory for certificate, which does not exist by default. From 0553b396393be1f16936add943f41848a2d07abf Mon Sep 17 00:00:00 2001 From: Daniel Pan Date: Wed, 13 Mar 2024 22:46:10 +0800 Subject: [PATCH 3/3] Update deploy_seafile_with_docker.md --- manual/docker/deploy_seafile_with_docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/docker/deploy_seafile_with_docker.md b/manual/docker/deploy_seafile_with_docker.md index 432b20dc..f860f07f 100644 --- a/manual/docker/deploy_seafile_with_docker.md +++ b/manual/docker/deploy_seafile_with_docker.md @@ -41,7 +41,7 @@ Placeholder spot for /opt/seafile-data volumes. You may elect to store certain p * /opt/seafile-data/seafile: This is the directory for seafile server configuration and data. * /opt/seafile-data/seafile/logs: This is the directory that would contain the log files of seafile server processes. For example, you can find seaf-server logs in `/opt/seafile-data/seafile/logs/seafile.log`. -* /opt/seafile-data/logs: This is the directory for logs. +* /opt/seafile-data/logs: This is the directory for operating system and Nginx logs. * /opt/seafile-data/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 `/opt/seafile-data/logs/var-log/nginx/`. * /opt/seafile-data/ssl: This is directory for certificate, which does not exist by default.