AutumnWhj / ChatGPT-wechat-bot

ChatGPT for wechat https://github.com/AutumnWhj/ChatGPT-wechat-bot
MIT License
4.66k stars 983 forks source link

我根据最新的代码创建了现成的Docker镜像,并上传到了Docker HUB #104

Open suyunkai opened 1 year ago

suyunkai commented 1 year ago

https://hub.docker.com/r/suyunkai46/chatgpt-wechat 需注意: 1、启动参数需要加上-dit,否则会马上自己关闭。 2、需要挂载容器内的/code/src/config.ts文件,然后修改它,加上openapi参数。 3、启动容器后控制台运行npm run dev即可扫码 4、可以在控制台输入npm install -g pm2,安装pm2。然后用pm2 start npm -- run dev命令启动程序,这样的话,随时可以输入指令pm2 logs查看日志记录。

openainext commented 1 year ago

一直回复的英文啊

soboker commented 1 year ago

微信群,触发关键字可以用中文么? 我现在怎么发都触发不了群回复。

znkey commented 1 year ago

没有config.ts文件,src里面是空的。是我哪里错了吗?请指教下,谢谢!

17huiwei commented 1 year ago

楼主,能给个完整的安装命令行么?我等小白只能看代码分析

liuruidong4 commented 1 year ago

可以的!

liuruidong4 commented 1 year ago

楼主,能给个完整的安装命令行么?我等小白只能看代码分析

进src目录 docker run -itd --name wechatbot -v pwd:/code/src suyunkai46/chatgpt-wechat 挂载一下src文件夹配置就是 docker exec -it wechatbot bash 进去容器里 npm run dev
然后等着扫码 就完事了

liuruidong4 commented 1 year ago

没有config.ts文件,src里面是空的。是我哪里错了吗?请指教下,谢谢!

本来容器里就是空的呀 要你挂载本地的

17huiwei commented 1 year ago

pm2 logs

特别感谢!

17huiwei commented 1 year ago

没有config.ts文件,src里面是空的。是我哪里错了吗?请指教下,谢谢!

自己下载,然后映射

huluohu commented 1 year ago

https://hub.docker.com/r/suyunkai46/chatgpt-wechat 需注意: 1、启动参数需要加上-dit,否则会马上自己关闭。 2、需要挂载容器内的/code/src/config.ts文件,然后修改它,加上openapi参数。 3、启动容器后控制台运行npm run dev即可扫码 4、可以在控制台输入npm install -g pm2,安装pm2。然后用pm2 start npm -- run dev命令启动程序,这样的话,随时可以输入指令pm2 logs查看日志记录。

大佬,您构建镜像的dockerfile能共享下吗,目前源码里的dockerfile貌似跟实际代码配置有差异,构建一直报错。

hetaozhen commented 1 year ago

一直回复的英文啊

你得要求它跟你说中文,它就会说了

s0ng1 commented 1 year ago

代码更新了,可以发布个新版的docker吗?

whitexiong commented 1 year ago

我挂 pm2 一直后启动后一段时间后报错启动不起来是怎么回事? image

znkey commented 1 year ago

没有config.ts文件,src里面是空的。是我哪里错了吗?请指教下,谢谢!

自己下载,然后映射

OK. 我下载源代码上传到映射的文件夹然后重启容器,能启动了.感谢!

suyunkai commented 1 year ago

https://hub.docker.com/r/suyunkai46/chatgpt-wechat 需注意: 1、启动参数需要加上-dit,否则会马上自己关闭。2、需要挂载容器内的/code/src/config.ts文件,然后修改它,加上openapi参数。3、启动容器后控制台运行npm run dev即可扫码 4、可以在控制台输入npm install -g pm2,安装pm2。然后用pm2 start npm -- run dev命令启动程序,这样的话,随时可以输入指令pm2 logs查看日志记录。

大佬,您构建镜像的dockerfile能共享下吗,目前源码里的dockerfile貌似跟实际代码配置有差异,构建一直报错。 以下是我的构建代码,能成功构建

FROM node:18 WORKDIR /code ADD package.json package-lock.json /code/ RUN apt-get update && apt-get install -y apt-utils RUN apt-get update -qq && apt-get install -y -qq curl RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - RUN apt-get update -qq && apt-get install -y -qq nodejs

Suppress an apt-key warning about standard out not being a terminal. Use in this script is safe.

ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn

Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)

Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer

installs, work.

去除了wget的安装,将wget的安装和chrome的安装都打包成了docker镜像。

在没有科学上网的设备上,可能因为网络问题无法下载linux_signing_key.pub文件而进度卡住(如服务器搭建不方便搭梯子)

RUN apt-get update \ && apt-get install -y wget gnupg \ && wget -q -O - https://gitlab.com/yyc5/test/-/raw/a7ed9e5920614037a6c35a1076c2197dae8f5b0f/linux_signing_key.pub?inline=false | apt-key add - \ && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ && apt-get update \ && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* ADD . /code RUN npm i RUN npm install -g npm@9.2.0

此dockerfile文件引导完,需要进一步操作,请看readme文件。引导过程有部分爆红不影响,进度一直向下等待build 好即可。

Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteery

huluohu commented 1 year ago

https://hub.docker.com/r/suyunkai46/chatgpt-wechat 需注意: 1、启动参数需要加上-dit,否则会马上自己关闭。2、需要挂载容器内的/code/src/config.ts文件,然后修改它,加上openapi参数。3、启动容器后控制台运行npm run dev即可扫码 4、可以在控制台输入npm install -g pm2,安装pm2。然后用pm2 start npm -- run dev命令启动程序,这样的话,随时可以输入指令pm2 logs查看日志记录。

大佬,您构建镜像的dockerfile能共享下吗,目前源码里的dockerfile貌似跟实际代码配置有差异,构建一直报错。 以下是我的构建代码,能成功构建

FROM node:18 WORKDIR /code ADD package.json package-lock.json /code/ RUN apt-get update && apt-get install -y apt-utils RUN apt-get update -qq && apt-get install -y -qq curl RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - RUN apt-get update -qq && apt-get install -y -qq nodejs

Suppress an apt-key warning about standard out not being a terminal. Use in this script is safe.

ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn

Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)

Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer

installs, work.

去除了wget的安装,将wget的安装和chrome的安装都打包成了docker镜像。 #在没有科学上网的设备上,可能因为网络问题无法下载linux_signing_key.pub文件而进度卡住(如服务器搭建不方便搭梯子) RUN apt-get update && apt-get install -y wget gnupg && wget -q -O - https://gitlab.com/yyc5/test/-/raw/a7ed9e5920614037a6c35a1076c2197dae8f5b0f/linux_signing_key.pub?inline=false | apt-key add - && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && apt-get update && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends && rm -rf /var/lib/apt/lists/* ADD . /code RUN npm i RUN npm install -g npm@9.2.0 #此dockerfile文件引导完,需要进一步操作,请看readme文件。引导过程有部分爆红不影响,进度一直向下等待build 好即可。

Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteery

非常感谢。

whao123yahoo commented 1 year ago

没有config.ts文件,src里面是空的。是我哪里错了吗?请指教下,谢谢!

自己下载,然后映射

OK. 我下载源代码上传到映射的文件夹然后重启容器,能启动了.感谢!

在哪里下载的😂

Jas0nxlee commented 1 year ago

启动后报错如下: retry 1 times, error: Error: ChatGPT error 503: { "error": { "message": "That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID edf1df32ea4f50e2af3a2c16494d090b in your message.)", "type": "server_error", "param": null, "code": null } }

retry 2 times, error: Error: ChatGPT error 503: { "error": { "message": "That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 18776f23d0a098847963e33fd70058ae in your message.)", "type": "server_error", "param": null, "code": null } }

whao123yahoo commented 1 year ago

不是说了吗,满负载了

发自我的小米 在 Jas0nxlee @.***>,2023年2月9日 10:12写道:

启动后报错如下: retry 1 times, error: Error: ChatGPT error 503: { "error": { "message": "That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID edf1df32ea4f50e2af3a2c16494d090b in your message.)", "type": "server_error", "param": null, "code": null } }

retry 2 times, error: Error: ChatGPT error 503: { "error": { "message": "That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 18776f23d0a098847963e33fd70058ae in your message.)", "type": "server_error", "param": null, "code": null } }

— Reply to this email directly, view it on GitHubhttps://github.com/AutumnWhj/ChatGPT-wechat-bot/issues/104#issuecomment-1423516913, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFAZ4HYFSGLWUNN2KOT5JWDWWRHAPANCNFSM6AAAAAAURDELGA. You are receiving this because you commented.Message ID: @.***>

suyunkai commented 1 year ago

补充:docker hub里,latest版本是chatgpt的api,现在已经不能用了。3.0版本是GPT3的API,可用