Heroku:部署基于 Spray 的服务

Heroku: deploy Spray based service

我有一个简单的 Scala 项目,它有几个 Maven 模块。它看起来像这样:

Parent project
|- service1
|- service2
|-...
|- serviceN
 |- Procfile
 |- ...
 |- pom.xml

我试图将 serviceN 部署到 heroku(现在,只有 serviceN,没有其他服务)。在该服务的目录中,我执行了以下命令:

heroku create serviceN
git push heroku master

ServiceN 是一个 Spray.io 项目,我试图在 interface=0.0.0.0 和 port=8080 上公开我的 Web 服务(在一些示例项目中看到)。

推送完成后,we界面给我:

An error occurred in the application and your page could not be served. Please try again in a few moments.

当我运行heroku ps时,没有输出。当我 运行 heroku scale web=1 我得到错误:

Scaling dynos... failed
 !    Couldn't find that formation.

我的 Procfile(没有扩展名,开头大写 P)看起来像这样(我用 maven 构建,所以我的应用程序被识别为 Java 应用程序):

web: java $JAVA_OPTS -cp target/serviceN.jar com.service.ObjectWithMain

当我查看日志时,我看到了这个:

2015-11-22T20:11:11.886773+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="MY_WS_ENDPOINT" host=serviceN.herokuapp.com request_id=71fad213-66d5-4186-a9fd-20ef505908e9 fwd="91.104.133.218" dyno= connect= service= status=503 bytes=
2015-11-22T20:11:12.217106+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=static-data-service.herokuapp.com request_id=cabd051a-1e37-4edd-841b-4a0eb875baf6 fwd="91.104.133.218" dyno= connect= service= status=503 bytes=

请帮我找出我错过了什么。

Procfile 必须存在于 Git 存储库的根目录中。 Procfile 中的命令还必须相对于根目录(当 heroku 运行它时,这将是当前工作目录)。