简体   繁体   English

从Apache-Docker-Container访问Wildfly-Docker-Container

[英]Access Wildfly-Docker-Container from Apache-Docker-Container

to test my web-application I am building a Docker-Setup. 为了测试我的Web应用程序,我正在构建一个Docker-Setup。 In one container an apache is running on which the PHP-Frontend is deployed, another container has the wildfly with the actual application running (java .war-file) and a third container has a Postgresql-DB that holds the application's data. 在一个容器中,一个正在运行的Apache部署了PHP前端,另一个容器中有运行实际应用程序的野蝇(java .war-file),而第三个容器具有一个Postgresql-DB,用于保存应用程序的数据。

When I am trying now to access the frontend through a browser I receive an exception and it tells me that the wildfly refused the connection. 现在,当我尝试通过浏览器访问前端时,我收到一个异常,它告诉我Wildfly拒绝了连接。
fopen( http://172.17.0.3:8080/[...] ): failed to open stream: Connection refused fopen( http://172.17.0.3:8080/ [...] ):无法打开流:连接被拒绝
I am pretty much out of ideas now and would be rather thankful for every input I can get. 我现在几乎没有主意了,我将为我能得到的每一个输入而感激。 I dont really think anyone knows the perfect answer, but maybe I can receive some ideas that get me onto the right track. 我真的认为没有人知道完美的答案,但是也许我可以得到一些使我走上正确道路的想法。

So is this due to the wildfly-setup ? 那是由于wildfly设置引起的吗? Some authentication problem between the containers ? 容器之间的某些身份验证问题?

Thanks in advance 提前致谢

docker run -p 9876:9990 -v /root/share:/root/share --name wildfly --entrypoint=/home/container_start.sh -it wildfly_image

This command is not exposing the port 8080, you are exposing the port 9876 to 9876 此命令未公开端口8080,而是公开了端口9876至9876

You can try to use localhost:9876 您可以尝试使用localhost:9876

https://docs.docker.com/engine/reference/commandline/port/ https://docs.docker.com/engine/reference/commandline/port/

Your service expose an HTTP server on 9990? 您的服务在9990上公开了HTTP服务器?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM