- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的文件结构:
requirements.txt
Procfile
Chess/
-- lichess-bot/
-- lichess-bot.py
-- config.yml
-- (many other files related to lichess-bot.py)
config.py中负责打开YAML的部分:
def load_config(config_file):
with open(config_file) as stream:
try:
CONFIG = yaml.load(stream)
except Exception as e:
print("There appears to be a syntax problem with your config.yml")
raise e
在 lichess-bot.py
中,这是对 config.yml
的调用:
CONFIG = load_config(args.config or "./config.yml")
我需要执行的命令是
chmod +x ./engines/stockfish_10_x64
python lichess-bot.py -u
我在 Heroku bash 中尝试了这个:python ./chess/lichess-bot/lichess-bot.py -u
但它返回
FileNotFoundError: [Errno 2] No such file or directory: './config.yml'
我尝试了这个Procfile
:
worker: cd chess
worker: cd lichess-bot
worker: chmod +x ./engines/stockfish_10_x64
worker: python lichess-bot.py -u
但 Heroku 无法识别它。
如果我手动执行此操作:
~ $ cd chess
~/chess cd lichess-bot
~/chess/lichess-bot python lichess-bot.py -u
完美运行
如何从Procfile
访问目录,然后执行文件而不出错?
最佳答案
代码默认为当前目录中名为config.yml
的配置文件:
CONFIG = load_config(args.config or "./config.yml")
您可以将 config.yml
移至存储库的根目录,也可以提供 args.config
。看起来可以通过 --config
来完成。
您的Procfile
应该只定义进程类型。它们不是脚本,也不应该包含很多“步骤”。类似的东西
worker: python lichess-bot.py --config chess/lichess-bot/config.yml -u
应该可以工作(假设您的目录实际上名为 chess/
而不是 Chess/
)。如果您需要使引擎可执行,请考虑在本地执行此操作并将其作为可执行文件提交。
关于python - Heroku Procfile 不进入目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56623013/
我正在学习如何部署 Django 与 合作的项目赫罗库 . 我注意到这个存储库中有两个文件(教程中的 git):https://github.com/heroku/python-getting-sta
我正在尝试将我的第一个 Java Web 应用程序上传到网络,但我无法处理 Procfile。部署后,有有关成功部署的信息,但当我尝试运行该应用程序时,出现错误,服务器日志似乎表明 Procfile
我有这个简单的 Procfile web: myapp myapp 在路径中,但进程主目录应该是 ./directory/。如何在 Procfile 中指定要启动进程的位置? https://gith
我正在尝试部署 Heroku 应用程序。 我一定是 Procfile 出了问题。当我运行 foreman check 时,出现此错误。 ERROR: no processes defined 在 He
Procfile 中要写什么? 我正在使用 Maven 编写一个 Web 应用程序来制作 .war 打包。当我使用 Tomcat 制作 Artifact filmography2:warexplode
我已经看够了它的外观,我必须更多地了解它。我看到 Heroku 有一个 procfile,我认为它是关于在部署到 heroku 后运行这个 procfile。 我还看到了术语基于 procfiled
上下文: 我正在编写一个中等大小的 Flask 应用程序(10-15 个 View ),在此过程中,我希望以一种易于维护和可扩展的方式组织代码(而不是像大多数 Flask 应用程序那样的单一文件)。
这是我的文件结构: requirements.txt Procfile Chess/ -- lichess-bot/ -- lichess-bot
我在读取大于缓冲区的 proc 文件时遇到问题。我看过这两个问题,我想我遗漏了一些东西。我是否错误地使用了 buffer_location 指针? How can I read large data
我正在尝试在 Heroku 上使用 Django,并且我正在使用其 Django 模板 https://devcenter.heroku.com/articles/django-app-configu
我的一个 friend 在 stackoverflow 上有同样的问题: 我从本教程中复制了代码:http://www.thegeekstuff.com/2012/04/create-proc-fil
我有一个 Flask 应用程序,我在其中嵌入了 Bokeh 服务器图,但我无法让它们同时在 Heroku 上工作。我正在尝试在 Heorku 上部署,我可以从 Procfile 启动 Bokeh 应用
对于 Heroku 上的 Django 应用程序,我的 Procfile 中应该包含什么? 我试过: web: python appname.py 因为我找到了一个类似 python 应用程序的示例。
我正在使用 foreman 启动一堆服务,并在 Procfile 中有以下行。 web: bundle exec rails server -p ${PORT:-3000} 然而,当服务器启动时
这是我第一次使用Heroku,而且在Google中找不到与此错误类似的人,这意味着我可能做错了什么: 我正在遵循基本的Heroku setup guide here将NodeJS应用程序部署到Web。
我一直在尝试设置命令来启动 Heroku 的 Java Spark 应用程序。它说无法找到或加载主类。我尝试了该命令的许多变体,修改了路径和参数,但无济于事。知道错误可能来自哪里吗? 我的 Procf
我对 Heroku 很陌生。 我将我的 Rails 应用程序上传到 Heroku,并希望使用 Thin 而不是 Webrick 来运行它。关注 Heroku’s guide我应该使用 web: bun
我开发了 Telegram 机器人并上传到 Heroku。但 30 分钟后我的应用程序进入休眠状态并且无法唤醒。我认为它发生了,因为我在 ProcFile 中写入了不正确的命令,并且 sleep 后端
我正在尝试将我的简单 SpringMVC 应用程序部署到 heroku。我几乎完成了,但在命令后的最后一刻 git push heroku master 消息来了 push rejected, no
这个问题在这里已经有了答案: multiple worker/web processes on a single heroku app (1 个回答) 关闭 3 年前。 我有两个不同的工作器,我想在
我是一名优秀的程序员,十分优秀!