# 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）。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://potoyang.gitbook.io/spring-in-action-v5/di-19-zhang-bu-shu-spring/19.6-zhong-zhang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
