feat: support docker/container running

This commit is contained in:
limccn
2023-02-14 14:14:36 +08:00
parent fa127c869e
commit 296f3d0d47
9 changed files with 148 additions and 0 deletions

View File

@@ -139,6 +139,34 @@ nohup python3 app.py & tail -f nohup.out # 在后台运行程序并通
> **特殊指令:** 用户向机器人发送 **#清除记忆** 即可清空该用户的上下文记忆。
3.如果是在docker **容器运行**,可以在`根\docker`目录下:
首先修改Dockerfile.alpine文件里第9行关于openapi key的配置
```bash
BUILD_OPEN_AI_API_KEY='YOUR OPEN AI KEY HERE'
```
然后使用docker-compose启动容器运行
```bash
docker-compose up
```
如果您的环境里没有安装docker-compose可以使用docker build方式构建Image使用以下命令
```bash
chmod +x build.alpine.sh #构建脚本添加执行权限
./build.alpine.sh #构建容器基于alpine
```
然后通过已构建完成的Image启动容器使用以下命令
```bash
docker run -it --name sample-chatgpt-on-wechat zhayujie/chatgpt-on-wechat:1.0.0-alpine
```
同时,我们在`根\docker\sample-chatgpt-on-wechat`下提供了Makefile脚本方便使用
```bash
cd sample-chatgpt-on-wechat #进入sample-chatgpt-on-wechat目录
make run_i #使用交互式方式启动容器
```
## 常见问题
FAQs <https://github.com/zhayujie/chatgpt-on-wechat/wiki/FAQs>