如何将 Docker-compose 管理的 Docker 容器推送到 Heroku? [英] How to push Docker containers managed by Docker-compose to Heroku?
问题描述
我目前有一个经过本地测试且可运行的 Web 应用程序,其中包含 4 个 docker 容器:Java MVC、NodeJS、Flask 和 MongoDB.我有 4 个 Dockerfile,每个文件一个,我使用 docker-compose.yml 管理构建.
I currently have a locally tested and working web app that consists of 4 docker containers: Java MVC, NodeJS, Flask, and MongoDB. I have 4 Dockerfiles, one for each, and I manage the builds with docker-compose.yml.
但是,现在我想将我的代码推送到 Heroku,我阅读了 https://devcenter.heroku.com/articles/container-registry-and-runtime.但是,如何在生产线上使用docker-compose似乎很模糊.这是它在文档上所说的:
However, now I want to push my code to Heroku and I read the documentation at https://devcenter.heroku.com/articles/container-registry-and-runtime. However, it seems very ambigious about how to use docker-compose on the production line. This is what it says on the docs:
如果您创建了一个多容器应用程序,您可以使用 Docker Compose 来定义您的本地开发环境.了解如何使用 Docker Compose 进行本地开发."
"If you’ve created a multi-container application you can use Docker Compose to define your local development environment. Learn how to use Docker Compose for local development."
谁能指导我使用 Heroku 的 CLI 将我的项目推送到 Heroku 容器的一些实际代码?
Can anyone guide me to some actual code of how I can push my project to the Heroku Container using Heroku's CLI?
推荐答案
只是对这个问题的更新,因为它最近似乎受到了很多关注.
Just an update on this question since it seems to be getting a lot of traction lately.
现在有一个官方支持的Heroku.yml" Heroku 提供的解决方案.您现在可以编写一个 .yml 文件(格式类似于 docker-compose),Heroku 将计算出您的图像.只需按照上面的链接了解详情.
There is now an officially supported "Heroku.yml" solution offered by Heroku. You can now write a .yml file (with a format similar to docker-compose) and Heroku will work out your images. Just follow the link above for details.
Heroku 游戏愉快.
Happy Heroku-ing.
这篇关于如何将 Docker-compose 管理的 Docker 容器推送到 Heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!