You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/website/docs/deployment/dev.md

55 lines
861 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
sidebar_position: 99
title: 开发环境
---
对于开发环境的搭建tailchat 提供了非常简单快捷的方式
## 后端
### 使用Docker快速搭建依赖环境
mongodb
```bash
docker run -d --name mongo -p 27017:27017 mongo:4
```
redis
```bash
docker run -d --name redis -p 6379:6379 redis
```
minio
```bash
docker run -d \
-p 19000:9000 \
-p 19001:9001 \
--name minio \
-e "MINIO_ROOT_USER=tailchat" \
-e "MINIO_ROOT_PASSWORD=com.msgbyte.tailchat" \
minio/minio server /data --console-address ":9001"
```
### 启动开发服务器
```bash
cp .env.example .env
vim .env
```
编辑`.env`的配置为自己相关的上下文
```bash
pnpm install # 安装环境变量
pnpm dev # 启动开发服务器
```
## 前端
```bash
cd web
pnpm install # 安装依赖
pnpm plugins:all # 编译插件
pnpm dev # 进入开发模式
```