当将Spring Boot应用程序部署为Linux中的服务时,如何动态传递或指定application.yml?

问题描述 投票:0回答:2

我正在按照以下文档-https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment-initd-service中的说明选择将Spring Boot应用程序作为服务部署到Linux中的选项。

但是在这里我没有看到如何在计算机上指定自定义application.yml的选项。也就是说,当我称为``服务myApp启动''时,我想在机器中维护一个application.yml及其所有凭据和其他详细信息,并将其传递给服务。请对此提供输入。

谢谢!

我正在按照以下文档中的说明选择在Linux中将Spring Boot应用程序作为服务部署的选项-https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html# ...

spring-boot
2个回答
0
投票

Spring Boot也可以从外部文件读取配置。


0
投票

有几种选择方式可以实现:

© www.soinside.com 2019 - 2024. All rights reserved.