S
S
sindrom2015-05-29 19:27:43
System administration
sindrom, 2015-05-29 19:27:43

Application in docker: why split into containers?

I'm getting started with Docker. I like the idea of ​​isolating all the dependencies of a complex application inside a single container. But from reading the manuals, I learned about the need to separate the services (for example: nginx, php-fpm, mysql, mongo, redis) that are part of the application into different containers and their subsequent linking. I don't quite understand why this should be done. Why can't you create one container with all the necessary dependencies inside? Or is it technically impossible?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2015-05-29
@edinorog

I would argue about isolation =). there was an excellent article on this subject. habrahabr.ru/post/258595 there are so many holes that this supermega miracle is only suitable for a home server for "playing around!"

I
iborzenkov, 2015-08-27
@iborzenkov

Yes, no reason is needed.
They have manuals written because we can do it so cool.
Make a separate container with (nginx, php-fpm, mysql, mongo, redis) and your site and great. In general, I see the point of dividing only into 3 parts in production - the storage in which all your databases are located and which you need to back up (just convenient - with a container), the code that you change and scale during deployment, and the balancers that the application has the same
In the base containers task to deploy by quick utility to see.
Believe me, nothing good will come of this
sudo docker ps | wc -l
92
at 10 services
Combine your application into a container, if your web application requires several databases to work, with a dozen workers on the backend, a complex nginx config, a bunch of crons, and so on, then wrap it all in one container.
Well, if you have a simple site on a standard framework and one base, then you don’t really need containers.

O
OnYourLips, 2015-05-29
@OnYourLips

Why can't you create one container with all the necessary dependencies inside? Or is it technically impossible?
Then it turns out that there will be no pluses from Docker, but there will be solid minuses.
IMHO docker is poorly suited for sales, only for tasks like "play with PHP7".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question