diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore index 7298af6..90bbdef 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ _config.yml config.yml config.example.yml compile.bat +.cache/ liteyuki/resources/templates/latest-debug.html # vuepress .github diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..58839fe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.11-bullseye + +ENV TZ Asia/Shanghai + +COPY docker/sources.list /etc/apt/sources.list + +RUN apt-get update && apt-get install -y git + +WORKDIR /liteyukibot + +COPY . /liteyukibot + +RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple + +RUN apt-get install -y libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libxkbcommon0 libasound2 + +EXPOSE 20216 + +CMD ["python", "main.py"] \ No newline at end of file diff --git a/docker/sources.list b/docker/sources.list new file mode 100644 index 0000000..e0d1a18 --- /dev/null +++ b/docker/sources.list @@ -0,0 +1,10 @@ +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free +# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free +# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free + +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free +# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free + +deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free +# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free \ No newline at end of file diff --git a/docs/deployment/install.md b/docs/deployment/install.md index 891c03a..4e45cd8 100644 --- a/docs/deployment/install.md +++ b/docs/deployment/install.md @@ -10,12 +10,25 @@ tag: ## **开始安装** +### **常规方法** 1. 安装 [`Git`](https://git-scm.com/download/) 和 [`Python3.10+`](https://www.python.org/downloads/release/python-31010/) 环境 2. 克隆项目 `git clone https://github.com/snowykami/LiteyukiBot` 3. 进入轻雪目录 `cd LiteyukiBot` 4. 安装依赖 `pip install -r requirements.txt` 5. 启动 `python main.py` +### **使用Docker** +1. 安装 [`Docker`](https://docs.docker.com/get-docker/) +2. 克隆项目 `git clone https://github.com/snowykami/LiteyukiBot` +3. 进入轻雪目录 `cd LiteyukiBot` +4. 构建镜像 `docker build -t liteyukibot .` +5. 启动容器 `docker run -p 20216:20216 -v $(pwd):/liteyukibot -v $(pwd)/.cache:/root/.cache liteyukibot` + +[//]: # () +[//]: # (> [!tip]) + +[//]: # (> Windows请使用`%cd%`代替`$(pwd)`) + ## **设备要求** - Windows系统版本最低`Windows10+`/`Windows Server 2019+` - Linux系统要支持Python3.10+,推荐`Ubuntu 20.04+`(~~别用你那b CentOS~~) diff --git a/requirements.txt b/requirements.txt index c3ad033..0d5db0c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,6 @@ nonebot-adapter-onebot~=2.4.3 nonebot-plugin-alconna~=0.43.0 nonebot_plugin_apscheduler~=0.4.0 packaging~=23.1 -playwright~=1.17.2 psutil~=5.9.8 py-cpuinfo~=9.0.0 pydantic~=2.7.0