Understanding Docker in Production

I studied how to use Docker to set up a development environment, however, I am curious how these ideas translate into the production stack. As an example, I have a Laravel (Php) application that uses MySQL, Redis and Nginx

So, in production, let's say I usually have 2 instances of an ec2 application to balance the load on AWS. When setting up a similar production situation using Docker ...

1), because I would use RDS and Elasticache, there would be no need for containers for them. So basically id only need containers for PHP-Fpm and Nginx?

2) in order to have high availability, I would have 2 (or less than 1) ec2 instances per ELB. Therefore, I assume that each instance will run the specified containers (PHP and Nginx). But this is no different from my previous virtual machine setup, where each server runs what it needs to serve the application. It's right?

3) with virtual machines, I would traditionally bake the code in the AMI and add these AMIs to the launch configuration and the autoscaling group, and this group will deploy the instances as necessary. Therefore, for deployment, I would rip old ec2 instances and deploy new ones. With Docker, since these containers will work on ec2 instances, will I still have to deploy / tear down virtual machines, or would I just replace the containers and save the virtual machines?

+4
2

RDS, Elasticache . EC2 .

, EC2 - . , , -, .

, DevOps - EC2 . , , , . , / , (-) .

AWS, AWS ECS, .

+4
  • , , . , , - .

  • , , Docker, -. , Docker EC2. , , , . EC2 .

  • AMI EC2 Docker . EC2. , , 0% .

+2

Source: https://habr.com/ru/post/1681553/


All Articles