连接到其他Docker容器的自托管哨兵
我有一个在127.0.0.1:8009运行的Web服务器的Docker容器,还安装了在127.0.0.0.1:9000上运行的自托管Sentry应用程序。但是现在,Web服务器无法连接到Sentry服务并发送错误消息。我还使用Docker容器名称进行测试,但它不起作用。
有人可以帮我管理吗?
I have a Docker container for my web server running on 127.0.0.1:8009 and I also installed the Self Hosted Sentry app running on 127.0.0.1:9000. But now the web server cannot connect to the sentry service and send error messages. I also test with the docker container name and it doesn't work.
Can someone help me manage it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在同一Docker网络中拥有Sentry和您的Web服务器,以便他们能够进行交流。
如果您使用docker-compose添加类似的内容,则您的哨兵组成文件:
以及类似的东西,您的Web服务器组成文件:
You need to have Sentry and your web server in the same docker network for them to be able to communicate.
If you use docker-compose add something like this to you sentry compose file:
And something like this to your web server compose file:
解决方案是添加一个额外的主机:
之后,您可以调用Localhost上运行的所有内容:with host.docker.internal:internal:
The solution is to add an extra host:
After that you can call everything running on localhost: with host.docker.internal: