连接到其他Docker容器的自托管哨兵

发布于 2025-02-07 09:35:33 字数 160 浏览 2 评论 0原文

我有一个在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故人如初 2025-02-14 09:35:33

您需要在同一Docker网络中拥有Sentry和您的Web服务器,以便他们能够进行交流。

如果您使用docker-compose添加类似的内容,则您的哨兵组成文件:

networks:
  default:
    name: "sentry"

以及类似的东西,您的Web服务器组成文件:

networks:
  default:
    external:
      name: sentry

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:

networks:
  default:
    name: "sentry"

And something like this to your web server compose file:

networks:
  default:
    external:
      name: sentry
回忆追雨的时光 2025-02-14 09:35:33

解决方案是添加一个额外的主机:

    extra_hosts:
        - "host.docker.internal:host-gateway"

之后,您可以调用Localhost上运行的所有内容:with host.docker.internal:internal:

The solution is to add an extra host:

    extra_hosts:
        - "host.docker.internal:host-gateway"

After that you can call everything running on localhost: with host.docker.internal:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文