[英]How do I really deploy docker-compose.yml to the cloud?
I have a docker-compose.yml
configuratio that spin up multiple services such as SQL Server
, redis
and Elasticsearch
.我有一个
docker-compose.yml
配置,可以启动多个服务,例如SQL Server
、 redis
和Elasticsearch
。 Everything is fine in the local development, I run docker-compose up -d --build
on a Windows machine and exposes its IP
and ports
number to the public.在本地开发中一切正常,我在 Windows 机器上运行
docker-compose up -d --build
并向公众公开其IP
和ports
号。 That's how I deploy my docker containers.这就是我部署 docker 容器的方式。
But how do I deploy it to the cloud?但是如何将其部署到云中呢? What website offers this service?
哪个网站提供这项服务? I know
AWS
could host containers but could it run docker-compose up -d --build
?我知道
AWS
可以托管容器,但它可以运行docker-compose up -d --build
吗?
I have been trying to google search deploy docker containers
but all I could find was to deploy the docker containers on your local machine, or use kubernetes
to deploy which I have no understanding about.我一直在尝试谷歌搜索
deploy docker containers
但我能找到的只是在本地机器上部署kubernetes
容器,或者使用kubernetes
进行部署,我对此一无所知。
I have an example here in my github repo of spinning up docker compose on Amazon Lightsail, but the process would be very similar for EC2我在我的 github 存储库中有一个在 Amazon Lightsail 上启动 docker compose 的示例,但是 EC2 的过程非常相似
Scroll down to the Docker part of the readme.向下滚动到自述文件的 Docker 部分。 For EC2 instead of using the "launch script" dialogue you just paste the script into the user data section in the EC2 creation process.
对于 EC2,您只需将脚本粘贴到 EC2 创建过程中的用户数据部分,而不是使用“启动脚本”对话框。
https://github.com/mikegcoleman/todo https://github.com/mikgcoleman/todo
Generally speaking docker-compose
can be used to deploy in a production environment.一般来说,
docker-compose
可以用于在生产环境中部署。 Only one difference that you can do, instead of build the image you can push the images to AWS ECR or any alternative registry like Gitlab registry if you are using Gitlab then you can pull the image directly to the server/instance where you are going to deploy.您可以做的只有一个区别,而不是构建映像,您可以将映像推送到AWS ECR或任何替代注册表,例如 Gitlab 注册表,如果您使用的是 Gitlab,那么您可以将映像直接拉到您要去的服务器/实例部署。
Also AWS has a service called ECS which also can be used to deploy containers but without using docker-compose
此外,AWS 有一项名为ECS的服务,它也可用于部署容器,但无需使用
docker-compose
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.