【问题标题】:using external config file for springboot in aws elastic beanstalk在aws elastic beanstalk中使用外部配置文件进行spring boot
【发布时间】:2018-05-17 06:49:09
【问题描述】:

我是 aws elastic beanstalk 的新手,我们曾经有一个 jar 中的 springboot 应用程序部署在 ec2 中。我们在外部存储 application.properties 和 log4j2 配置文件,并通过命令参数(--spring.configuration.location 等)使我们的 springboot jar 使用这些配置。现在我们想将我们的应用程序迁移到弹性 beantalk,我已经阅读了文档,但没有找到实现此目的的好方法,并且看起来那些配置文件必须打包在 jar 中。有没有办法将这些文件保留在 eb env 中的 jar 外部?

【问题讨论】:

    标签: amazon-web-services spring-boot amazon-elastic-beanstalk


    【解决方案1】:

    您可以使用 Procfile 将它们保存在 jar 外部。您的 procfile 有您的 java 命令来执行 JAR 并加载参数。

    http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-se-platform.html

    【讨论】:

    • 谢谢!我阅读了您提供的 url 中的文档,看起来它支持自定义命令,但是如何上传这些 conf 文件?目前我有一个 application.properties 和一个 log4j2.json,我应该将它们与 jar 一起压缩并上传到 eb 吗? @克里斯·波拉德
    • 你明白了!将它们与 jar 一起压缩并上传到 eb。
    猜你喜欢
    • 2018-11-05
    • 2016-07-01
    • 2013-04-11
    • 2017-09-28
    • 2018-04-20
    • 2017-07-03
    • 2020-11-26
    • 2017-07-14
    • 2018-06-13
    相关资源
    最近更新 更多