Skip to content

Commit

Permalink
📝 文档删除常规部署,强制使用虚拟环境
Browse files Browse the repository at this point in the history
  • Loading branch information
snowykami committed Oct 13, 2024
1 parent 4a5dd1f commit 3eaf23a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
24 changes: 17 additions & 7 deletions docs/zh/deploy/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,39 @@
title: 安装
order: 1
---

# 安装

## **常规部署**

1. 安装 [`Git`](https://git-scm.com/download/)[`Python3.10+`](https://www.python.org/downloads/release/python-31010/) 环境
1. 安装 [`Git`](https://git-scm.com/download/)[
`Python3.10+`](https://www.python.org/downloads/release/python-31010/) 环境

```bash
# 克隆项目到本地,轻雪使用Git进行版本管理,该步骤为必要项
git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1 # 若你不能访问Github,可以使用Liteyuki镜像:https://git.liteyuki.icu/LiteyukiStudio/LiteyukiBot

# 切换到Bot目录下
cd LiteyukiBot

# 创建虚拟环境
python -m venv venv

# 激活虚拟环境
.\venv\Scripts\activate # Windows
source venv/bin/activate # Linux

# 安装依赖
pip install -r requirements.txt

# 启动Bot
python main.py
```

> [!tip]
> 推荐使用虚拟环境来运行轻雪,以避免依赖冲突,你可以使用`python -m venv .venv`来创建虚拟环境,然后使用`.venv\Scripts\activate`来激活虚拟环境(Linux下使用`source .venv/bin/activate`激活)
## **使用Docker构建**

1. 安装 [`Docker`](https://docs.docker.com/get-docker/)
2. 克隆项目 `git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1`
2. 克隆项目 `git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1`
3. 进入轻雪目录 `cd LiteyukiBot`
4. 构建镜像 `docker build -t liteyukibot .`
5. 启动容器 `docker run -p 20216:20216 -v $(pwd):/liteyukibot -v $(pwd)/.cache:/root/.cache liteyukibot`
Expand All @@ -36,8 +44,9 @@ python main.py
> 若你修改了端口号请将`20216:20216`中的`20216`替换为你的端口号
## **使用TRSS Scripts部署**
[TRSS_Liteyuki轻雪机器人管理脚本](https://timerainstarsky.github.io/TRSS_Liteyuki/),该功能由TRSS提供支持,不是LiteyukiBot官方提供的功能,推荐使用`Arch Linux`

[TRSS_Liteyuki轻雪机器人管理脚本](https://timerainstarsky.github.io/TRSS_Liteyuki/)
,该功能由TRSS提供支持,不是LiteyukiBot官方提供的功能,推荐使用`Arch Linux`

## **装置要求**

Expand All @@ -48,7 +57,8 @@ python main.py
- 硬盘: 至少`1GB`空间

> [!warning]
> 如果装置上有多个环境,请使用`path/to/python -m pip install -r requirements.txt`来安装依赖,`path/to/python`为你的Python可执行文件路径
> 如果装置上有多个环境,请使用`path/to/python -m pip install -r requirements.txt`来安装依赖,`path/to/python`
> 为你的Python可执行文件路径
> [!warning]
> 轻雪的更新功能依赖Git,如果你没有安装Git直接下载源代码运行,你将无法使用更新功能
Expand Down
1 change: 1 addition & 0 deletions scripts/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git pull origin main

0 comments on commit 3eaf23a

Please sign in to comment.