docker - 将现有 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
还有其他方法可以设置stack
为container
吗?例如,根据这些文档,也可以使用 进行设置Dockerfile
,但不清楚具体如何执行此操作。
我知道我可以使用 heroku CLI,但我更愿意在我的 git repo 中进行设置,因为这个应用程序也将部署给其他用户。
提前感谢您的任何建议!
解决方案
只需要运行这个命令
$ heroku stack:set heroku-18 --app HEROKU_APP_NAME
推荐阅读
- generics - Rust 返回泛型特征的已知类型
- mysql - MySQL如何创建一个视图来处理查询参数
- netflix-eureka - server.context-path 在 springboot admin /Eureka 的健康端点中附加了两次
- java - 在 Java 中有没有办法在异常期间知道方法参数的值?
- typescript - TypeScript 映射类型更改值函数的返回类型
- javascript - 将函数的进度输出到执行 Promise 内部的控制台
- angular - 如何修复这些漏洞?(npm audit fix 无法修复这些漏洞)
- spring - 将war部署到tomcat并出现错误(java.lang.NoSuchMethodError:org.slf4j.spi.LocationAwareLogger)
- firebase - 云功能 Firebase 无法正常工作
- java - 尝试比较来自同一类的两个对象时出现 AssertionFailedError 错误(在覆盖 Equals() 和 Hashcode() 之后)