Docker部署
zhayujie edited this page 2023-06-26 13:14:14 +08:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

推荐根据README中docker部署一节直接下载docker-compose.yml并从docker hub拉取官方镜像。需要自己手动构建镜像的才需要看以下内容

1.修改配置

首先,在docker-compose.yaml文件里修改所需导入的环境变量。(还需要指定 build 配置)

2.构建镜像

然后使用docker-compose启动容器运行

docker-compose up                  

如果您的环境里没有安装docker-compose可以使用docker build方式构建Image使用以下命令

chmod +x build.alpine.sh           # 构建脚本添加执行权限
./build.alpine.sh                  # 构建容器基于alpine

3.启动容器

然后通过已构建完成的Image启动容器执行以下命令

docker run -it --name sample-chatgpt-on-wechat zhayujie/chatgpt-on-wechat:1.0.0-alpine        

同时,我们在 docker/sample-chatgpt-on-wechat 下提供了 Makefile 脚本,方便进入容器:

cd sample-chatgpt-on-wechat          # 进入sample-chatgpt-on-wechat目录
make run_i                           # 使用交互式方式启动容器

Author: @limccn

详细文档: Docker部署