> For the complete documentation index, see [llms.txt](https://potoyang.gitbook.io/spring-in-action-v5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://potoyang.gitbook.io/spring-in-action-v5/di-19-zhang-bu-shu-spring/19.6-zhong-zhang.md).

# 19.6 总结

* Spring 应用程序可以部署在许多不同的环境中，包括传统的应用程序服务器、CloudFoundry 等平台即服务（PaaS）环境，或作为Docker容器部署。
* 在构建WAR文件时，您应该包括一个子类 SpringBootServletInitializr 以确保 Spring 的 DispatcherServlet 配置正确。
* 构建为可执行 JAR 文件允许 Spring Boot 应用程序部署到多个云平台，而无需 WAR 文件。
* 容器化 Spring 应用程序就像使用用于 Maven 的 Dockerfile 插件一样简单。它将一个可执行的 JAR 文件包装在 Docker 容器中，该容器可以部署在任何可以部署 Docker 容器的地方，包括云提供商，如 Amazon Web Services、Microsoft Azure、Google Cloud Platform、Pivotal Web Services (PWS)、和关键容器服务（PKS）。
