首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >向通过dokku部署的python堆栈(django)添加新的dokku

向通过dokku部署的python堆栈(django)添加新的dokku
EN

Stack Overflow用户
提问于 2017-07-20 15:06:10
回答 1查看 249关注 0票数 1

我正在尝试将新的遗物添加到通过dokku部署的django网站。

我已经安装了newrelic并添加到需求中,还创建了newrelic.ini文件并添加到存储库中。

我也更改了我的Procfile的命令,所以它是这样的:

代码语言:javascript
复制
NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program gunicorn config.wsgi:application

然而,当我执行deloy时,我得到了一个奇怪的错误,守护进程报告文件不存在:

代码语言:javascript
复制
(ticker_env) mattions@apollo:ticker(add_newrelic*)$ git push dokku add_newrelic:master
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 4.21 KiB | 0 bytes/s, done.
Total 8 (delta 3), reused 0 (delta 0)
remote: master
-----> Cleaning up...
-----> Building ticker from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
       Detected buildpacks: multi nodejs python
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-python.git
=====> Detected Framework: Python
-----> Installing requirements with pip

-----> $ python manage.py collectstatic --noinput
       DEBUG 2017-07-20 06:55:42,979 base 529 139977271977792 Configuring Raven for host: <raven.conf.remote.RemoteConfig object at 0x7f4ef31a7a90>
       111 static files copied to '/tmp/build/staticfiles', 111 post-processed.

       Using release configuration from last framework (Python).
-----> Discovering process types
       Procfile declares types -> web, tracker
-----> Releasing ticker (dokku/ticker:latest)...
-----> Deploying ticker (dokku/ticker:latest)...
-----> Attempting to run scripts.dokku.predeploy from app.json (if defined)
-----> App Procfile file found (/home/dokku/ticker/DOKKU_PROCFILE)
-----> DOKKU_SCALE file found (/home/dokku/ticker/DOKKU_SCALE)
=====> web=1
=====> tracker=1
-----> Attempting pre-flight checks
       For more efficient zero downtime deployments, create a file CHECKS.
       See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples
       CHECKS file not found in container: Running simple container check...
-----> Waiting for 10 seconds ...
644dd10a08b1186f90570d2c4186027533da19a53648c36f380f1c1ee480f04c
remote: App container failed to start!!
=====> ticker web container output:
       setuidgid: fatal: unable to run NEW_RELIC_CONFIG_FILE=newrelic.ini: file does not exist
       setuidgid: fatal: unable to run NEW_RELIC_CONFIG_FILE=newrelic.ini: file does not exist
       setuidgid: fatal: unable to run NEW_RELIC_CONFIG_FILE=newrelic.ini: file does not exist
       setuidgid: fatal: unable to run NEW_RELIC_CONFIG_FILE=newrelic.ini: file does not exist
       setuidgid: fatal: unable to run NEW_RELIC_CONFIG_FILE=newrelic.ini: file does not exist
=====> end ticker web container output
To ideallab.org:ticker
 ! [remote rejected] add_newrelic -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@ideallab.org:ticker'

该文件位于存储库和分支中。我是否需要修改构建包以确保正确地考虑到这一点?

EN

回答 1

Stack Overflow用户

发布于 2017-07-20 15:53:03

我已经弄明白了。

只需通过dokku将NEW_RELIC_CONFIG_FILE导出为环境变量,而不要将其添加到Procfile中。在可能的情况下,ticker是应用程序的名称

代码语言:javascript
复制
dokku config:set ticker NEW_RELIC_CONFIG_FILE=newrelic.ini

然后procfile是

代码语言:javascript
复制
newrelic-admin run-program gunicorn config.wsgi:application
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45207610

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档