添加 Docker 支持
This commit is contained in:
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM nonebot/nb-cli:latest
|
||||
WORKDIR /
|
||||
RUN apt update && apt install -y git
|
||||
RUN git clone https://github.com/jiajiu123/MaiMBot
|
||||
WORKDIR /MaiMBot
|
||||
RUN mkdir config
|
||||
RUN mv /app/env.example /app/config/.env \
|
||||
&& mv /app/src/plugins/chat/bot_config_toml /app/config/bot_config.toml
|
||||
RUN ln -s /app/config/.env /app/.env \
|
||||
&& ln -s /app/config/bot_config.toml /app/src/plugins/chat/bot_config.toml
|
||||
RUN pip install -r requirements.txt
|
||||
VOLUME [ "/app/config" ]
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT [ "nb","run" ]
|
||||
11
README.md
11
README.md
@@ -31,6 +31,17 @@
|
||||
|
||||
### 安装方法(还没测试好,现在部署可能遇到未知问题!!!!)
|
||||
|
||||
#### Linux 使用 Docker Compose 部署
|
||||
获取项目根目录中的```docker-compose.yml```文件,运行以下命令
|
||||
```bash
|
||||
NAPCAT_UID=$(id -u) NAPCAT_GID=$(id -g) docker compose up -d
|
||||
```
|
||||
配置文件修改完成后,运行以下命令
|
||||
```bash
|
||||
NAPCAT_UID=$(id -u) NAPCAT_GID=$(id -g) docker compose restart
|
||||
```
|
||||
|
||||
#### 手动运行
|
||||
1. **创建Python环境**
|
||||
推荐使用conda或其他环境管理来管理你的python环境
|
||||
```bash
|
||||
|
||||
51
docker-compose.yml
Normal file
51
docker-compose.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
services:
|
||||
napcat:
|
||||
container_name: napcat
|
||||
environment:
|
||||
- tz=Asia/Shanghai
|
||||
- NAPCAT_UID=${NAPCAT_UID}
|
||||
- NAPCAT_GID=${NAPCAT_GID}
|
||||
ports:
|
||||
- 3000:3000
|
||||
- 3001:3001
|
||||
- 6099:6099
|
||||
restart: always
|
||||
volumes:
|
||||
- napcatQQ:/app/.config/QQ
|
||||
- napcatCONFIG:/app/napcat/config
|
||||
image: mlikiowa/napcat-docker:latest
|
||||
|
||||
mongodb:
|
||||
container_name: mongodb
|
||||
environment:
|
||||
- tz=Asia/Shanghai
|
||||
expose:
|
||||
- "27017"
|
||||
restart: always
|
||||
volumes:
|
||||
- mongodb:/data/db
|
||||
- mongodbCONFIG:/data/configdb
|
||||
image: mongo:latest
|
||||
|
||||
maimbot:
|
||||
container_name: maimbot
|
||||
build: .
|
||||
environment:
|
||||
- tz=Asia/Shanghai
|
||||
expose:
|
||||
- "8080:8080"
|
||||
restart: always
|
||||
depends_on:
|
||||
- mongodb
|
||||
- napcat
|
||||
volumes:
|
||||
- maimbotCONFIG:/app/config
|
||||
image: jiajiu/maimbot:latest
|
||||
|
||||
|
||||
volumes:
|
||||
maimbotCONFIG:
|
||||
napcatQQ:
|
||||
napcatCONFIG:
|
||||
mongodb:
|
||||
mongodbCONFIG:
|
||||
Reference in New Issue
Block a user