首页 > 解决方案 > 将现有 heroku 应用程序的堆栈从 heroku-18 设置为 Docker 映像的“容器”?

问题描述

我正在尝试找到一种将堆栈设置为“容器”的方法,这样我就可以将我的应用程序部署在 docker 映像而不是 heroku-18 中。造成这种情况的原因很复杂,但却是必要的。

Heroku Docker 映像设置文档说我可以在我的文件中执行此操作app.json,如下所示:

"stack": "container"

但是这样做会在通过在线界面部署时导致错误:

 !     No default language could be detected for this app.
            HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
            See https://devcenter.heroku.com/articles/buildpacks
 !     Push failed

还有其他方法可以设置stackcontainer吗?例如,根据这些文档,也可以使用 进行设置Dockerfile,但不清楚具体如何执行此操作。

我知道我可以使用 heroku CLI,但我更愿意在我的 git repo 中进行设置,因为这个应用程序也将部署给其他用户。

提前感谢您的任何建议!

标签: dockerherokuplotly-dash

解决方案


只需要运行这个命令

$ heroku stack:set heroku-18 --app HEROKU_APP_NAME

推荐阅读