Answer the question
In order to leave comments, you need to log in
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
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!"
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.
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question