-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbfb7c8
commit 2746318
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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=<your-api-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. |
32 changes: 32 additions & 0 deletions
32
website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/cdn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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=<your-api-url> pnpm build | ||
``` | ||
|
||
确保 `SERVICE_URL` 的值是后端的地址,形如: `http://127.0.0.1:11000` | ||
|
||
编译完毕后你可以在 `tailchat/client/web/dist` 目录下获得所有的前端文件。 |