From eee17c5b9fb7c25aca2f032cdbd090897d09168d Mon Sep 17 00:00:00 2001 From: morvanzhou Date: Thu, 23 May 2024 09:49:20 +0800 Subject: [PATCH] feat(md): update --- README.md | 27 ++++++++++++++++++++++----- README_ZH.md | 7 ++++++- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f69eb99..9ee4e3f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,11 @@ Making the new thought more connectable and memorable. which makes it easy to synchronize across multiple platforms. 5. **Multi-language**: Support multiple languages, including Chinese and English. +Deploy methods: + +- [Deploy with Docker](#deploy-with-docker) +- [Deploy with Python](#deploy-with-python) + ## Deploy with Docker ### Pull the image: @@ -56,21 +61,33 @@ docker pull morvanzhou/rethink For keeping your data safe, you should mount a local path to the container. ```shell -docker run -p 8080:8080 -v /your/data/path:/app/.data morvanzhou/rethink +docker run \ + -p 8080:8080 \ + -v /your/data/path:/app/.data \ + morvanzhou/rethink ``` Then you can visit `http://127.0.0.1:8080` in your browser. -If you want to define another host's port, you have to also add an environment variable `API_URL`: +If you want to define another host's port, you have to also add an environment variable `API_URL`, +and make sure the port is the same as the host's port (`8001` in this example): ```shell -docker run -e API_URL=http://127.0.0.1:8001 -p 8001:8080 -v /your/data/path:/app/.data morvanzhou/rethink +docker run \ + -e API_URL=http://127.0.0.1:8001 \ + -p 8001:8080 \ + -v /your/data/path:/app/.data \ + morvanzhou/rethink ``` -If you want to set a password for authorization, you have to also add a environment variable `APP_PASSWORD`: +If you want to set a password for authorization, just add a environment variable `APP_PASSWORD`: ```shell -docker run -e APP_PASSWORD=12345678 -p 8080:8080 -v /your/data/path:/app/.data morvanzhou/rethink +docker run \ + -e APP_PASSWORD=12345678 \ + -p 8080:8080 \ + -v /your/data/path:/app/.data \ + morvanzhou/rethink ``` ### All environment variables: diff --git a/README_ZH.md b/README_ZH.md index a4dbcf6..e408575 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -38,6 +38,11 @@ Rethink 表示重新思考,是对个人成长的新理解。 ,便于在多个平台之间同步; 5. **多语言**:支持多种语言,包括中文和英文。 +安装部署方式: + +- [使用 Docker 容器化部署](#使用-docker-容器化部署) +- [使用 Python 部署](#使用-python-部署) + ## 使用 Docker 容器化部署 ### 拉取镜像: @@ -57,7 +62,7 @@ docker run -p 8080:8080 -v /your/data/path:/app/.data morvanzhou/rethink 现在你可以在浏览器中访问 `http://127.0.0.1:8080` 使用服务。 如果你想自定义其他端口,你除了需要修改 `-p` 参数的前半部分,还需要添加一个环境变量 `API_URL` 来重定向前端服务中的 API 的地址: -请确保 `API_URL` 里的端口号和 `-p` 参数的前半部分一致。 +请确保 `API_URL` 里的端口号和 `-p` 参数的前半部分一致 (在下面案例中的 `8001` 端口)。 ```shell docker run -e API_URL=http://127.0.0.1:8081 -p 8081:8080 -v /your/data/path:/app/.data morvanzhou/rethink