我正在尝试安装New Relic,但它显示我需要对Procfile进行更改。不过,我似乎在我的应用程序的本地副本的根目录中找不到它。我正在使用Django。
谢谢
发布于 2012-11-10 23:36:22
Heroku上的这个页面提供了更多关于procfile是什么的信息:https://devcenter.heroku.com/articles/procfile
你不一定要有一个部署到Heroku上,但你可以手动创建一个,以便更多地控制Heroku如何运行你的应用程序。根据上面链接的摘录:
部署用Heroku支持的大多数语言编写的应用程序时,不需要配置文件。该平台自动检测语言,并创建默认的web进程类型来引导应用程序服务器。
建议创建显式Procfile,以便对应用程序进行更好的控制和灵活性。
要让Heroku使用您的Procfile,请将Procfile添加到您的应用程序的根目录中,推送到Heroku:
$ git add .
$ git commit -m "Procfile"
$ git push heroku
...
-----> Procfile declares process types: web, worker
Compiled slug size is 10.4MB
-----> Launching... done
http://strong-stone-297.herokuapp.com deployed to Heroku
To git@heroku.com:strong-stone-297.git
* [new branch] master -> master发布于 2014-08-13 19:40:09
对于New Relic支持,您必须显式地告诉Heroku在New Relic中运行gunicorn实例。所以你的Procfile应该看起来像这样:
newrelic-admin run-program gunicorn --workers 4 --worker-class gevent --timeout 60 mysite.wsgi通过有条件地在Heroku环境变量中查找新的遗物许可证,您可以在不更改Procfile的情况下打开或关闭此功能:
Procfile:
web: bash scripts/heroku_runscripts/heroku_run:
#!/bin/bash
run_command="gunicorn --workers 4 --worker-class gevent --timeout 60 mysite.wsgi"
# Run through New Relic monitoring if add-on installed
if [[ $NEW_RELIC_LICENSE_KEY != '' ]]; then
newrelic-admin run-program $run_command
else
$run_command
fihttps://stackoverflow.com/questions/13323335
复制相似问题