gxthrj commented on a change in pull request #785: URL: https://github.com/apache/apisix-dashboard/pull/785#discussion_r522190693
########## File path: docs/deploy.zh-CN.md ########## @@ -17,118 +17,80 @@ # --> -# 从源文件打包部署 +# 源码构建并启动 -## 克隆项目 - -```sh -$ git clone -b v2.0 https://github.com/apache/apisix-dashboard.git - -$ cd apisix-dashboard -``` +Dashboard 包含了 `manager-api` 与 `web` 两部分,其中 `web` 是*可选*的。 ## 构建 -### Manager-api 检查项 +本构建指南将包含 `web` 控制台。 -`manager-api` 用于为控制台提供接口,就像 Apache APISIX 和控制台之间的桥梁。下面是手动构建步骤: +### 环境准备 -1. 需要预先安装 `Go` 1.13+ +在构建之前,请确认您的环境中,已安装如下依赖: -注意:如果使用插件编排,需要同时预先安装 `Lua` 5.1+ ,后续版本会对此进行优化,取消对 `Lua` 的依赖。 +#### manager-api -2. 检查环境变量 - -- 对于大多数中国用户,我们可以使用 [Goproxy](https://goproxy.cn/) 加快模块下载速度。 +1. [Golang](https://golang.org/dl/) 1.13+:对于中国大陆的用户,可使用如下命令加快模块下载速度。 ```sh $ go env -w GOPROXY=https://goproxy.cn,direct ``` -### 前端 检查项 +2. [Lua](https://www.lua.org/download.html) 5.1+:仅在使用**插件编排**功能时,需要安装本依赖。在后续版本中,会对该部分进行优化以取消对其依赖。 -该项目使用 [Ant Design Pro](https://pro.ant.design) 初始化。以下是一些使用方法的快速指南。 +#### web -1. 确保你的设备已经安装了 `Node.js(版本 10.0.0+)`。 +1. [Node.js](https://nodejs.org/en/download/) 10.23.0+ +2. [Yarn](https://yarnpkg.com/getting-started/install) -2. 安装 [yarn](https://yarnpkg.com/)。 +### 克隆项目 -### 开始构建 +```sh +$ git clone -b v2.0 https://github.com/apache/apisix-dashboard.git +``` +### 开始构建 ```sh +$ cd apisix-dashboard $ make build ``` -构建完成后的文件在根目录 `output` 下。 +构建完成后,构建结果将存放在根目录下 `output` 目录中。 + +注意:`make build` 将会构建 `manger-api` 与 `web`,使用 `make help` 命令以查看更多指令。 ## 启动 -1. 根据您的部署环境,检查并修改 `output/conf/conf.yaml` 中的配置。 - -例如: - -```yaml -conf: - listen: - host: 127.0.0.1 - port: 8080 - etcd: - endpoints: - - 127.0.0.1:2379 -authentication: - secret: secret - expire_time: 3600 - users: - - username: admin - password: admin - - username: user - password: user -``` +1. 根据您的部署环境,检查并修改 `output/conf/conf.yaml` 中的配置信息。 -2. 启动 Apache APISIX Dashboard +2. 启动 Dashboard ```sh $ cd ./output + $ ./manager-api +# 或后台常驻 +$ ./manager-api & ``` -3. 在浏览器中访问 `http://127.0.0.1:8080`,`8080` 是 manager-api 的默认监听端口。 +启动成功后,控制台将输出启动成功信息。 -4. 关闭 Apache APISIX Dashboard +3. 在未修改配置的情况下,访问 `http://127.0.0.1:8080` 以使用有前端界面的控制台,默认用户密码均为 `admin`。 -```sh -$ kill $(ps aux | grep 'manager-api' | awk '{print $2}') -``` - -## 打包 output 目录 - -你可以把刚刚 output 目录整体打包,copy 到其他地方解压运行,output 目录包含运行 Apache APISIX Dashboard 需要的所有文件(配置文件、可执行文件、web静态资源) +4. 停止 Dashboard ```sh -$ make release-src +$ kill $(ps aux | grep 'manager-api' | awk '{print $2}') Review comment: will be done in #787 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
