Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

docker部署如何设置监听地址? #428

Closed
LeonX86 opened this issue Dec 23, 2022 · 4 comments
Closed

docker部署如何设置监听地址? #428

LeonX86 opened this issue Dec 23, 2022 · 4 comments
Labels
question Further information is requested

Comments

@LeonX86
Copy link

LeonX86 commented Dec 23, 2022

docker部署,网络是直接host模式(为了从公网ipv6访问)
然后测试下来在.env文件中的监听地址为127.0.0.1时候ipv4和ipv6都打不开
换成0.0.0.0,ipv4显示{"detail":"Not Found"} ipv6继续打不开
image
有什么好的办法吗

@mnixry mnixry added the question Further information is requested label Dec 27, 2022
@mnixry
Copy link
Owner

mnixry commented Dec 27, 2022

可以看uvicorn的文档: https://www.uvicorn.org/settings/#socket-binding

Use --host 0.0.0.0 to make the application available on your local network. IPv6 addresses are supported, for example: --host '::'.

@LeonX86
Copy link
Author

LeonX86 commented Dec 28, 2022

可以看uvicorn的文档: https://www.uvicorn.org/settings/#socket-binding

Use --host 0.0.0.0 to make the application available on your local network. IPv6 addresses are supported, for example: --host '::'.

看了一下他的文档并搜索了一下,ipv4现在成功了,但是因为gocqhttp里默认的本地反代就是127.0.0.1
所以写ipv6 HOST=::这样子会直接连不上
image
然后我看HOST这个参数好像也没法同时写两个值?
就是说只能ipv4和ipv6二选一嘛

@mnixry
Copy link
Owner

mnixry commented Dec 28, 2022

那你可以不用host网络模式(

可以用Docker带的那个端口映射开到公网,比较方便👀

@LeonX86
Copy link
Author

LeonX86 commented Dec 28, 2022

docker的端口映射是只能ipv4的,ipv6的话只支持host(这似乎是docker的bug网上也有很多帖子说),没事就这样吧,不折腾了,能内网穿透访问看就行啦

@LeonX86 LeonX86 closed this as completed Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants