-
Notifications
You must be signed in to change notification settings - Fork 60.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Docker 构建镜像后访问3000端口页面无法打开(本地和服务器均是)ERR_CONNECTION_RESET #4682
Comments
Title: [Bug] After Docker builds the image, the page accessing port 3000 cannot be opened (both locally and on the server) ERR_CONNECTION_RESET Bug DescriptionAs title Steps to Reproduce
Expected BehaviorThe previous version can be built normally and pushed for deployment ScreenshotsCheck the docker log:
Deployment Method
Desktop OSMacOS 13/Ubuntu 20.04 Desktop BrowserNo response Desktop Browser VersionNo response Smartphone DeviceNo response Smartphone OSNo response Smartphone BrowserNo response Smartphone Browser VersionNo response Additional LogsNo response |
尝试在容器内部手动执行 |
After trying to manually execute |
在容器内运行 |
Run |
二分法查了一下,可能是把Next.js从13.4.9升级到14.1.1导致的 |
After checking the dichotomy, it may be caused by upgrading Next.js from 13.4.9 to 14.1.1 |
尝试仅回滚next.js升级的部分,问题依旧存在 |
Tried rolling back only the upgrade part of next.js, the problem still exists |
same question |
Looking forward to the solution!!! |
Looks like they are working on a fix: #4689, guess that's something caused by the update of next.js -> 14. As a temporary walkaround, add the following one-liner to the docker run command: docker run -d --network host yidadaa/chatgpt-next-web:v2.12.3 sh -c 'if [ -n "$PROXY_URL" ]; then export HOSTNAME="0.0.0.0"; protocol=$(echo $PROXY_URL | cut -d: -f1); host=$(echo $PROXY_U
RL | cut -d/ -f3 | cut -d: -f1); port=$(echo $PROXY_URL | cut -d: -f3); conf=/etc/proxychains.conf; echo "strict_chain" > $conf; echo "proxy_dn
s" >> $conf; echo "remote_dns_subnet 224" >> $conf; echo "tcp_read_time_out 15000" >> $conf; echo "tcp_connect_time_out 8000" >> $conf; echo "l
ocalnet 127.0.0.0/255.0.0.0" >> $conf; echo "localnet ::1/128" >> $conf; echo "[ProxyList]" >> $conf; echo "$protocol $host $port" >> $conf; ca
t /etc/proxychains.conf; proxychains -f $conf node server.js; else node server.js; fi' Now the container binds 0.0.0.0:
|
我也遇到了相同问题,我想是代理的原因。 |
I also encountered the same problem, I think it is the proxy. |
@LoopOptimum 不是代理的问题。之前为了解决 #1556 ,这里加了个逻辑:如果有 但是 |
@LoopOptimum It's not the proxy's problem. In order to solve #1556, a logic was added here: if there is However, |
我回滚到v2.12.2 没有出现这个问题, v2.12.3 尝试用ipv6 可以访问,但是API请求超时 |
I rolled back to v2.12.2 and this problem did not occur. v2.12.3 can be accessed when trying to use ipv6, but the API request times out. |
请问你删除后有尝试过自己再次构建docker镜像吗?我按你的方案删除了
docker logs结果next.js依然监听127.0.0.1
同时也尝试修改HOSTNAME="0.0.0.0" 问题依旧没有得到解决 也许是我绑定的本地port端口为3001(测试目的)所导致的,有任何想法或建议吗? |
Have you tried building the docker image again after deleting it? I deleted
At the same time, I also tried to modify HOSTNAME="0.0.0.0" but the problem was still not solved. |
这样设置以后的log是什么?删掉这行的确不能解决问题,见 #4689 (comment) 。我最终的解决方案是 |
What will be the log after setting like this? |
我参考#4682 (comment)的方法重新执行docker run命令,绑定本机3000端口运行正常了。
修改了容器外监听端口为3001后就出现了问题,现在我已经重新使用3000端口,可以正常运行 |
I followed the method of #4682 (comment) and re-executed the docker run command. Binding the local port 3000 ran normally.
The problem occurred after I changed the listening port outside the container to 3001. Now I have reused port 3000 and it can run normally. |
在启动的时候覆盖Dockfile中 “export HOSTNAME=127.0.0.1” 为 “export HOSTNAME=0.0.0.0”,启动正常了! |
在启动的时候覆盖Dockfile中 “export HOSTNAME=127.0.0.1” 为 “export HOSTNAME=0.0.0.0”,启动正常了! |
看到现在还没有提供解决办法,我先临时用不重新编译的方式解决,方法如下:
这种方式影响小,希望对大伙有用。 附件:
|
Seeing that there is no solution provided yet, I will temporarily solve it without recompiling. The method is as follows:
This method has little impact and I hope it will be useful to everyone. appendix:
|
根据这个提示之后,我暂时用以下命令临时解决 |
After following this tip, I temporarily solved it by using the following command |
After checking the dichotomy, it may be caused by upgrading Next.js from 13.4.9 to 14.1.1 |
已经解决,不过代理不能用127.0.0.1:端口,只能用主机自己的局域网IP |
It has been solved, but the proxy cannot use the 127.0.0.1: port, and can only use the host's own LAN IP. |
Dockerfile: Listen to any addresses instead of localhost, fixes #4682
现在好像仍然无法使用。 docker 里面目前是使用 --host 的方式添加参数的, 但是 docker 界面里面仍然是 127.0.0.1:3000. PR 的最后的一部分的修改 应该是没合并到镜像里面: d411159 |
It still seems to be unavailable. Docker currently uses the --host method to add parameters, but the docker interface is still 127.0.0.1:3000. The modifications to the last part of the PR should not be merged into the image: d411159 |
我的评价是纯纯的弱智。
绑定你妈的 |
My assessment is purely retarded.
Bind your damn 10.10.10.10... |
Bug Description
如题
Steps to Reproduce
git clone https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
cd ChatGPT-Next-Web
docker build --platform=linux/amd64 -t myname .
docker tag myname account/myname:latest
docker push account/myname:latest
docker pull account/myname:latest
docker run -d -p 3000:3000 \ -e OPENAI_API_KEY=sk-xxxx \ -e CODE=your-password \ account/myname
Expected Behavior
之前版本是可以正常构建并且push部署
同时我尝试了本地构建本地运行,出现ERR_CONNECTION_RESET
Screenshots
查看docker日志:
docker logs e2f4518c958c
Deployment Method
Desktop OS
MacOS 13 /Ubuntu 20.04
Desktop Browser
No response
Desktop Browser Version
No response
Smartphone Device
No response
Smartphone OS
No response
Smartphone Browser
No response
Smartphone Browser Version
No response
Additional Logs
No response
The text was updated successfully, but these errors were encountered: