A
A
Andrey Strelkov2020-12-04 20:05:42
PHP
Andrey Strelkov, 2020-12-04 20:05:42

Is it correct to use Docker to run websites in a production environment?

Good afternoon, tell me please. How correct and logical (mainly in terms of performance) is to use a Docker container to host websites individually in your container.

Those. for example, there are 20 web sites on CMS (Drupal), and there is, for example, a standard practice when one server is for the web, the second is for the database, on the first there are 20 web sites, on the second there are 20 databases for them.
And the second option, when there is one virtual machine with docker, and 2 container images, similarly with a web server and subd. This virtual machine breeds 20 containers with a web server and 20 with subds.

How much worse / better in terms of performance will it be when the site is running in a container, or when it’s just on a separate web server

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2020-12-04
@AleksandrB

https://habr.com/ru/post/346430/
My opinion is that everything depends on everything. It is clear that if you have an rps load of 100k, then docker will not be the best solution, but if we are talking about a simple store, then why not? Test. Moreover, there is a direct dependence on the directness of your hands when setting up the docker itself. If the site loses a lot in performance - give up docker, no - use it.
But I ask you, do not use something just because you want to try something new or experiment, other money is paid for your experiments.

S
Saboteur, 2020-12-05
@saboteur_kiev

Depends on.
In general, running several web servers, each in its own container, is not a good idea, because extra resources are wasted, port crap, and nginx / apache easily work with multiple sites. And here the meaning can only be in security.
Another thing is if these are web services that run their own web servers (built into nodejs, python, java).

S
Sanes, 2020-12-05
@Sanes

Those. for example there are 20 websites on CMS (Drupal)

Run each as a separate user. You will have both isolation and control of resources. There is nothing for docker to do there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question