简体   繁体   English

我如何真正将 docker-compose.yml 部署到云端?

[英]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 ServerredisElasticsearch 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并向公众公开其IPports号。 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.

相关问题 如何从AWS中的开发docker-compose.yml转到已部署的docker-compose.yml - how to go from development docker-compose.yml to deployed docker-compose.yml in aws 我可以将 AWS Copilot 与 docker-compose.yml 文件一起使用吗? - Can I use AWS Copilot with docker-compose.yml file? 如何在 AWS Elastic Container Service 中使用现有的 docker-compose.yml 文件? - How to use existing docker-compose.yml file in AWS Elastic Container Service? AWS Elastic Beanstalk 不支持 docker-compose.yml 吗? - is docker-compose.yml not supported in AWS Elastic Beanstalk? AWS Elastic Beanstalk 与 AMI2 和 docker-compose.yml - AWS Elastic Beanstalk with AMI2 and docker-compose.yml 将 Docker-Compose YML 部署到 AWS ECS - Deploy Docker-Compose YML to AWS ECS docker-compose 显示所有不是在 docker-compose.yml 中定义的服务 - docker-compose displaying all services not the one defined in docker-compose.yml 错误:撰写文件“./docker-compose.yml”无效,因为:services.jenkins.networks 包含无效类型 - ERROR: The Compose file './docker-compose.yml' is invalid because: services.jenkins.networks contains an invalid type AWS ECS-CLI docker-compose.yml depends_on 错误“services.nginx.depends_on.0 必须是字符串” - AWS ECS-CLI docker-compose.yml depends_on error "services.nginx.depends_on.0 must be a string" 在AWS ECS中使用docker-compose.yml和ecs-params.yml文件以不同的Lauch类型和卷安装来运行多个任务定义 - Run multiple task-definition using docker-compose.yml and ecs-params.yml file in AWS ECS with different lauch type and volume mounting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM