Skip to content

Commit

Permalink
docs: add cdn deployment document
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Aug 8, 2023
1 parent cbfb7c8 commit 2746318
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions website/docs/deployment/cdn.md
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.
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` 目录下获得所有的前端文件。

0 comments on commit 2746318

Please sign in to comment.