在生产中部署 Spring Boot [英] Deploying Spring Boot in Production

查看:39
本文介绍了在生产中部署 Spring Boot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 Spring Boot + Angular 应用程序.目前我们正在将其打包为 jar 并运行它.

We have a Spring Boot + Angular application. Currently we are packaging it as a jar and running it.

可以将包装用作 JAR 吗?或者我们应该转向 WAR 类型的包装.会有什么不同?

Is it ok to use the packaging as a JAR? Or should we move to a WAR type packaging. What would be the difference?

推荐答案

除了部署风格外,没有别的区别.

The difference is nothing else apart from the deployment style.

在使用 JAR 时,spring boot 创建的胖 JAR 包含嵌入的 tomcat.

When using a JAR, the fat JAR that spring boot creates contains embedded tomcat.

如果您团队的部署环境有一个应用服务器,如 WebLogic 或 Websphere 等,大多数企业环境尝试选择这些服务器,因为他们已经拥有这些或任何其他此类原因的许可,您将需要创建一个 WAR.

If your team's deployment environment has a Application server like WebLogic or Websphere etc., which most enterprise environment try to choose as they already have license for these or any other such reasons, you would need to create a WAR.

对于战争:

优点:

  • 创建战争是一个更安全的选择,因为您仍然可以根据需要在任何类型的应用程序或 Web 服务器中进行部署
  • 允许 DevOps 轻松挂钩控制服务器的启动和停止,前提是他们已经为其他已设置应用服务器的团队进行了设置.

缺点:

  • 如果要部署在应用程序/网络服务器中,则需要额外的配置和设置

这篇关于在生产中部署 Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆