如何解决部署docker后,localhost变为空白
我一直在探索docker,并使用servlet和SQL制作了简单的Web应用程序 我已经将dockerized sql并连接了JDBC名称。
student-jdbc
<div class="container">
<img src="https://source.unsplash.com/2Ts5HnA67k8/400x200">
<!-- SVG (purple) -->
<!-- Setting a viewbox can solve the Issue,but I would prefer not to. -->
<div class="wrapper">
<svg>
<!-- Define the Mask -->
<defs>
<circle r="20%" cx="43%" cy="20%" id="circle"/>
<mask id="mask">
<use x="0" href="#circle" fill="white">
<!-- Chrome hack around bug 330815 -->
<animate attributeName="href" to="#circle" begin="0" dur="0s"/>
</use>
</mask>
</defs>
<!-- The stroke of the masked cicle. -->
<use href="#circle" fill="transparent" stroke="white"/>
<!-- The Element we want to mask. -->
<image mask="url(#mask)" href="https://source.unsplash.com/2Ts5HnA67k8/400x200"></image>
</svg>
</div>
</div>
这是我的docker文件(我已完成复制.war文件)
public class StudentDAO {
private static String jdbcURL = "jdbc:mysql://db:3306/student_details?useSSL=false";
private static String jdbcUsername = "root";
private static String jdbcPassword = "password";
}
docker container run -it-发布8081:8080 your_name / some-app-image
当转到本地主机时它已经成功运行,在tomcat(在Java中)运行时我什么也没找到,这很好。有什么帮助吗?感谢您的浏览。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。