如何创建玩heroku procfile?
我按照这里的指示
http://blog.heroku.com/archives/2011/8/29 /play/
但我执行 play run
然后 git push heroku master
但未找到 procfile。
-----> No Procfile found. Will use process:
play run --http.port=$PORT $PLAY_OPTS
- 如何显式创建 procfile?
- 这些说明似乎表明我应该在应用程序运行时推送到
heroku master
。我读错了吗? - 在哪里可以为 mydomain.herokuapp.com 指定
$PORT
和$PLAY_OPTS
? - 只修改 application.conf 中
%prod
的值是否更好?
I am following the directions here
http://blog.heroku.com/archives/2011/8/29/play/
but I do play run
and then git push heroku master
but a procfile is not found.
-----> No Procfile found. Will use process:
play run --http.port=$PORT $PLAY_OPTS
- How do I explicitly create a procfile?
- The instructions seem to indicate that I should push to
heroku master
while the app is running. Am I reading that wrong? - Where can I specify
$PORT
and$PLAY_OPTS
for mydomain.herokuapp.com? - Is it better to just modify the values for
%prod
in application.conf?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要在项目的根目录中创建一个名为 Procfile 的文件,对于 Play,它应该包含
当您部署应用程序时,$PORT 和 $PLAY_OPTS 将在应用程序启动时由 heroku 设置。
You need to create a file named Procfile in the root of your project and for Play it should contain
When you then deploy your application the $PORT and $PLAY_OPTS will be set by heroku when the application is started.
创建 Procfile 就像听起来一样简单。只需创建一个名为 Procfile 的文件并声明您的进程类型和命令。更多信息如下:http://devcenter.heroku.com/articles/procfile
在本例中,您没有提供 Procfile,因此 Heroku 仅使用标准 Play 流程。最佳实践是显式提供 Procfile,以防将来此默认值发生更改。
不,你没有读错。要上传应用程序的新版本,您需要执行 git Push 到 heroku。
$PORT 变量由 Heroku 内部设置。无需设置。当您首次将 Play 应用程序推送到 Heroku 时,$PLAY_OPTS 变量会在您的应用程序空间中设置。您可以使用 heroku 命令行查看它。有关该命令行的更多信息如下:http://devcenter.heroku.com/articles/heroku-command
要查看您的应用程序配置:
要更改 $PLAY_OPTS:
默认情况下,heroku 将在 prod 框架 id 下运行 Play 应用程序。您可以在 Procfile 或 $PLAY_OPTS 变量中更改此设置。这里唯一重要的是你的应用程序在heroku上以PROD模式运行(注意该模式与框架id不同)。 Heroku 无法在 DEV 模式下运行 Play 应用程序。
Creating a Procfile is as simple as it sounds. Just create a file called Procfile and declare your process types and commands. More information is here: http://devcenter.heroku.com/articles/procfile
In this case, you didn't provide a Procfile so Heroku just used the standard Play process. It's best practice to explitly provide a Procfile in case this default changes in the future.
No, you are not reading that wrong. To upload a new version of your app you perform a git push to heroku.
The $PORT variable is set internally by Heroku. No need to set it. The $PLAY_OPTS variable is set in your app space when you first push your Play app to Heroku. You can see it using the heroku command line. More information on that command line is here: http://devcenter.heroku.com/articles/heroku-command
To view your app configuration:
To change $PLAY_OPTS:
By default, heroku will run Play apps under the prod framework id. You can change this in your Procfile or in the $PLAY_OPTS variable. The only important thing here is that your app run in PROD mode on heroku (note that mode is different from framework id). Heroku cannot run Play apps in DEV mode.
这在很大程度上取决于您使用的游戏版本。我检查了文档并找到了每个给定版本的以下
Procfile
:1.x
2.0
2.2.0
2.2.1
有关特定版本的更多信息,请检查此 URL:
确保将
2.2.1
替换为您正在使用的任何版本。It will considerably depend on the play version you're using. I checked the docs and found the following
Procfile
s for each of the given versions:1.x
2.0
2.2.0
2.2.1
For more information for the specific version check this URL:
Make sure you replace
2.2.1
with whatever version you're using.