【问题标题】:Running dropwizard 1.1.2 on heroku在 heroku 上运行 dropwizard 1.1.2
【发布时间】:2017-12-14 19:13:46
【问题描述】:

我有一个可以在本地运行的 dropwizard 1.1.2 应用程序。我尝试将它部署到 heroku,我读到我需要覆盖 Procfile 中 heroku 提供的端口值,如下所示:

web: java $JAVA_OPTS -Ddw.http.port=$PORT -Ddw.http.adminPort=$PORT -jar target/My_Website-1.0-SNAPSHOT.jar server target/classes/app.yml

然而,这适用于旧版本的 Dropwizard,我无法找到 Dropwizard 1.1.2 与 heroku 一起使用的文档。如果我不提供端口信息,heroku 应用程序会启动,然后崩溃并显示以下消息:

错误 R10(启动超时)-> Web 进程在启动后 90 秒内未能绑定到 $PORT

将 Dropwizard 1.1.2 与 heroku 一起使用的正确 Procfile 和 config.yml 内容是什么?谢谢

【问题讨论】:

    标签: heroku dropwizard


    【解决方案1】:

    我想通了。您只需要在 Procfile 中传递 -Ddw.server.applicationConnectors[0].port=$PORT 而不是 -Ddw.server.adminConnectors[0].port=$PORT

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-29
      • 2015-12-18
      • 2018-01-28
      • 2016-03-23
      • 2013-08-27
      • 2012-04-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多