Answer the question
In order to leave comments, you need to log in
Should I use each Docker container separately for each running process?
Hello. I'm reading the book "Using Docker" by Adrien Mowat. In the book, he says that the docker developers believe that it is most correct to use one process per container in the operation of containers. Tell me, does this mean that if I want to deploy a web server, then I need at least 3 containers:
1. DBMS
2. Web server
3. The site itself.
Or is it all unprincipled and everything can be put into one container and will work just as well.
Answer the question
In order to leave comments, you need to log in
In the book, he says that the docker developers believe that it is most correct to use one process per container in the operation of containers.That's right. This is the main paradigm when using containerization. Legs grow from 12 factors . You can use one picture
Tell me, does this mean that if I want to deploy a web server, then I need at least 3 containersAnd there is. Further launch of all applications is carried out with one command. Since it turns out to be quite long (as if you are running a Java application), it is preferable to use docker-compose for this purpose. There is the only yaml file in which you can describe what to run in what order and, if necessary, restart, how much and what hardware resources to allocate to each application, and much more.
Or is it all unprincipled and everything can be put into one container and will work just as well.It is possible to do so. The truth is that it is easier and more reasonable not to bother with containers in this case.
1 DBMS
2 Web server
The site is usually located outside the container.
Or
1 DBMS
2 Front
3 Web application, which is a built image. Most often these are applications on nodejs, .net or python.
More logs in a separate place and configs. This is insanity. Set up a normal virtual machine.
It should be without docker. Good manners rules: school separately, site separately.
MYSQL through a UNIX socket works faster if everything runs on the same hardware, I don’t advise splitting
it though ... if you make a public folder (tmp) for containers, you can give access to the UNIX socket
For a web application, the main process is the web server serving client requests. It is worth isolating only it, and you need to connect it to the DBMS and file storage outside the container.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question