我正在尝试找到一种将堆栈设置为“容器”的方法,以便我可以将我的应用程序部署在 docker 镜像而不是 heroku-18 中。这样做的原因很复杂,但却是必要的。
Heroku Docker image setup docs说我可以在我的 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
?例如,根据 these docs也可以使用 Dockerfile
进行设置,但目前尚不清楚如何做到这一点。我知道我可以使用 heroku CLI,但我更愿意在我的 git repo 中设置它,因为这个应用程序也将部署给其他用户。
提前感谢您的任何建议!
最佳答案
将堆栈设置为 container
使用命令行(作为编辑 app.json
的替代方法),我相信
heroku stack:set container
会做的伎俩。您可以在此处阅读有关在 Heroku 上部署容器的更多信息(有关上述语法,请参阅入门的第 3 步):
https://devcenter.heroku.com/articles/build-docker-images-heroku-yml
关于docker - 将现有 heroku 应用程序的堆栈从 heroku-18 设置为 Docker 镜像的 'container'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59725708/