简体   繁体   English

webapp Docker Tomcat IntelliJ 的 URL

[英]URL for webapp Docker Tomcat IntelliJ

I'm using a Tomcat 9 server in a Docker container to deploy locally a webapp for development purposes.我在 Docker 容器中使用 Tomcat 9 服务器在本地部署 web 应用程序以进行开发。 I can connect to my Tomcat using http://localhost:8080/我可以使用 http://localhost:8080/ 连接到我的 Tomcat 本地主机Tomcat But I can't find my webapp URL anywhere.但是我在任何地方都找不到我的 webapp URL。 My Docker container is deployed from IntelliJ, and I have no URL field in the configuration of the Container.我的 Docker 容器是从 IntelliJ 部署的,我在容器的配置中没有 URL 字段。 IntelliJ 运行/调试配置

Does anyone know where to find/set the URL ?有谁知道在哪里可以找到/设置 URL?

There is no URL to be set, at least not explicitly.没有要设置的 URL,至少没有明确设置。

Once you have your application started in a container (either started through IntelliJ IDEA , Docker Desktop (for) , command line...) with the port binding configuration (the Bind ports config section in your screenshot), you are only left with the application as if it was started on the host on the mapped port (the first section before the colon : in the port binding).在使用端口绑定配置(屏幕截图中的绑定端口配置部分)在容器中启动应用程序(通过IntelliJ IDEADocker Desktop (for) 、命令行...启动)后,您只剩下应用程序就好像它是在映射端口上的主机上启动的(冒号之前的第一部分:在端口绑定中)。

Which means you can simply access your application on:这意味着您可以简单地访问您的应用程序:

http://localhost:8080

following the pattern for a URL: (protocol)://(host)(:port) where:遵循 URL 的模式: (protocol)://(host)(:port)其中:

  • protocol is HTTP since you mentioned using Tomcat as a web server protocol是 HTTP,因为您提到使用Tomcat作为 Web 服务器
  • host being you local station where the docker daemon is running on host是运行 docker 守护进程的本地站
  • port being the port you chose to map to the started container port port是您选择映射到已启动容器端口的端口

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

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