diff --git a/website/docs/deployment/cdn.md b/website/docs/deployment/cdn.md new file mode 100644 index 00000000..9591e471 --- /dev/null +++ b/website/docs/deployment/cdn.md @@ -0,0 +1,32 @@ +--- +sidebar_position: 11 +title: CDN Deployment (optional) +--- + +There may be cases where front-end and back-end are deployed separately. For example, if you want to manage front-end code separately in object storage, add CDN support. You need to compile the front-end code separately. + +Backend code is still recommended to use `docker` to deploy + +In order to compile the front-end code separately, you need to download the source code and compile it manually + +```bash +git clone https://github.com/msgbyte/tailchat.git +cd tailchat + +# You can switch between different distributions by git checkout v1.8.8 + +pnpm install # You need to use `pnpm` to install dependencies, using other package management tools may cause problems +``` + +Wait patiently for dependencies to be installed + +Enter the front-end code and compile it + +```bash +cd client/web +SERVICE_URL= pnpm build +``` + +Make sure the value of `SERVICE_URL` is the address of your api backend, for example: `http://127.0.0.1:11000` + +After compiling, you can get all the front-end files in the `tailchat/client/web/dist` directory. diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/cdn.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/cdn.md new file mode 100644 index 00000000..aea0bd04 --- /dev/null +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/cdn.md @@ -0,0 +1,32 @@ +--- +sidebar_position: 11 +title: 前端分离部署(CDN部署前端)(可选) +--- + +有可能会出现前后端分开部署的情况,比如想要把前端代码单独放在对象存储中管理,增加CDN支持。则需要单独编译前端代码。 + +后端代码依旧建议使用 `docker` 来部署 + +为了单独编译前端代码,你需要下载源码来手动编译 + +```bash +git clone https://github.com/msgbyte/tailchat.git +cd tailchat + +# 你可以通过 git checkout v1.8.8 来切换不同的发行版本 + +pnpm install # 你需要使用 `pnpm` 来安装依赖,使用其他的包管理工具可能会出现问题 +``` + +耐心等待依赖安装完毕 + +进入前端代码中,进行编译 + +```bash +cd client/web +SERVICE_URL= pnpm build +``` + +确保 `SERVICE_URL` 的值是后端的地址,形如: `http://127.0.0.1:11000` + +编译完毕后你可以在 `tailchat/client/web/dist` 目录下获得所有的前端文件。