diff --git a/manual/docker/deploy_seafile_with_an_existing_mysql_server.md b/manual/docker/deploy_seafile_with_an_existing_mysql_server.md new file mode 100644 index 000000000..c4214a22e --- /dev/null +++ b/manual/docker/deploy_seafile_with_an_existing_mysql_server.md @@ -0,0 +1,12 @@ +# Deploy with an existing MySQL server + +If you want to use an existing MySQL server, you can modify the `.env` as follows + +```env +SEAFILE_MYSQL_DB_HOST=192.168.0.2 +SEAFILE_MYSQL_DB_PORT=3306 +SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD +SEAFILE_MYSQL_DB_PASSWORD=PASSWORD +``` + +NOTE: `SEAFILE_MYSQL_ROOT_PASSWORD` is needed during installation (i.e., the deployment in the first time). After Seafile is installed, the user `seafile` will be used to connect to the MySQL server (SEAFILE_MYSQL_DB_PASSWORD), then you can remove the `SEAFILE_MYSQL_ROOT_PASSWORD`. \ No newline at end of file diff --git a/manual/docker/deploy_seafile_with_docker.md b/manual/docker/deploy_seafile_with_docker.md index 73da1d20a..ba5866c28 100644 --- a/manual/docker/deploy_seafile_with_docker.md +++ b/manual/docker/deploy_seafile_with_docker.md @@ -100,19 +100,6 @@ sudo tail -f $(find /opt/seafile-data/ -type f -name *.log 2>/dev/null) ## More configuration options -### Use an existing mysql-server - -If you want to use an existing mysql-server, you can modify the `.env` as follows - -```env -SEAFILE_MYSQL_DB_HOST=192.168.0.2 -SEAFILE_MYSQL_DB_PORT=3306 -SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD -SEAFILE_MYSQL_DB_PASSWORD=PASSWORD -``` - -NOTE: `SEAFILE_MYSQL_ROOT_PASSWORD` is needed during installation. Later, after Seafile is installed, the user `seafile` will be used to connect to the mysql-server (SEAFILE_MYSQL_DB_PASSWORD). You can remove the `SEAFILE_MYSQL_ROOT_PASSWORD`. - ### Modify Seafile server configurations The config files are under `/opt/seafile-data/seafile/conf`. You can modify the configurations according to [Seafile manual](https://manual.seafile.com/) @@ -133,31 +120,6 @@ 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. -### Run Seafile as non root user inside docker - -You can use run seafile as non root user in docker. (**NOTE:** Programs such as `my_init`, Nginx are still run as `root` inside docker.) - -First add the `NON_ROOT=true` to the `.env`. - -```env -NON_ROOT=true -``` - -Then modify `/opt/seafile-data/seafile/` permissions. - -```bash -chmod -R a+rwx /opt/seafile-data/seafile/ -``` - -Then destroy the containers and run them again: - -```bash -docker compose down -docker compose up -d -``` - -Now you can run Seafile as `seafile` user. (**NOTE:** Later, when doing maintenance, other scripts in docker are also required to be run as `seafile` user, e.g. `su seafile -c ./seaf-gc.sh`) - ## Backup and recovery Follow the instructions in [Backup and restore for Seafile Docker](../maintain/backup_recovery.md) diff --git a/manual/docker/deploy_seafile_pro_with_docker.md b/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md similarity index 89% rename from manual/docker/deploy_seafile_pro_with_docker.md rename to manual/docker/pro-edition/deploy_seafile_pro_with_docker.md index 756897ae8..4a21bdbeb 100644 --- a/manual/docker/deploy_seafile_pro_with_docker.md +++ b/manual/docker/pro-edition/deploy_seafile_pro_with_docker.md @@ -168,44 +168,6 @@ docker compose restart All Seafile log files are stored in `/opt/seafile-data/seafile/logs` whereas all other log files are in `/opt/seafile-data/logs/var-log`. -## Use an existing mysql-server - -If you want to use an existing mysql-server, you can modify the `.env` as follows - -```env -SEAFILE_MYSQL_DB_HOST=192.168.0.2 -SEAFILE_MYSQL_DB_PORT=3306 -SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD -SEAFILE_MYSQL_DB_PASSWORD=PASSWORD -``` - -NOTE: `SEAFILE_MYSQL_ROOT_PASSWORD` is needed during installation. Later, after Seafile is installed, the user `seafile` will be used to connect to the mysql-server (SEAFILE_MYSQL_DB_PASSWORD). You can remove the `SEAFILE_MYSQL_ROOT_PASSWORD`. - -## Run Seafile as non root user inside docker - -You can use run seafile as non root user in docker. (**NOTE:** Programs such as `my_init`, Nginx are still run as `root` inside docker.) - -First add the `NON_ROOT=true` to the `.env`. - -```env -NON_ROOT=true -``` - -Then modify `/opt/seafile-data/seafile/` permissions. - -```bash -chmod -R a+rwx /opt/seafile-data/seafile/ -``` - -Then destroy the containers and run them again: - -```bash -docker compose down -docker compose up -d -``` - -Now you can run Seafile as `seafile` user. (**NOTE:** Later, when doing maintenance, other scripts in docker are also required to be run as `seafile` user, e.g. `su seafile -c ./seaf-gc.sh`) - ## Backup and Recovery Follow the instructions in [Backup and restore for Seafile Docker](../../maintain/backup_recovery.md) diff --git a/manual/docker/run_seafile_as_non_root_user_inside_docker.md b/manual/docker/run_seafile_as_non_root_user_inside_docker.md new file mode 100644 index 000000000..52bce9f84 --- /dev/null +++ b/manual/docker/run_seafile_as_non_root_user_inside_docker.md @@ -0,0 +1,24 @@ +# Run Seafile as non root user inside docker + +You can use run seafile as non root user in docker. (**NOTE:** Programs such as `my_init`, Nginx are still run as `root` inside docker.) + +First add the `NON_ROOT=true` to the `.env`. + +```env +NON_ROOT=true +``` + +Then modify `/opt/seafile-data/seafile/` permissions. + +```bash +chmod -R a+rwx /opt/seafile-data/seafile/ +``` + +Then destroy the containers and run them again: + +```bash +docker compose down +docker compose up -d +``` + +Now you can run Seafile as `seafile` user. (**NOTE:** Later, when doing maintenance, other scripts in docker are also required to be run as `seafile` user, e.g. `su seafile -c ./seaf-gc.sh`) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ec613111e..c9da224b7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -86,6 +86,8 @@ nav: - Multiple Storage Backends: deploy_pro/multiple_storage_backends.md - Data migration: deploy_pro/migrate.md - Seafile Docker autostart: docker/seafile_docker_autostart.md + - Deploy with an existing MySQL server: docker/deploy_seafile_with_an_existing_mysql_server.md + - Run Seafile as non root user inside docker: docker/run_seafile_as_non_root_user_inside_docker.md - Cluster installation: - Seafile Docker Cluster Deployment: docker/cluster/deploy_seafile_cluster_with_docker.md - Setup with Kubernetes (K8s): deploy/deploy_with_k8s.md