T
T
Twelfth Doctor2018-01-31 17:19:01
Docker
Twelfth Doctor, 2018-01-31 17:19:01

Is it right to use Docker for website hosting?

Hello. Is it correct to use Docker for hosting sites so that the web server configuration files and the site directory are mounted into the container from the host using bind mount ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
InoMono, 2018-01-31
@InoMono

It's not meant for that.
But it is possible and so.
Although, initially it is assumed that your application is entirely placed in a container, along with all the configuration files and, as you put it, "the directory of the site itself".
Only what changes is mounted:
for example, logs (although it is considered normal in Docker to remove logs from stdout and stderr)
files uploaded by users (although in such systems they are increasingly stored on specialized file services such as AWS S3, Google Cloud, Openstack Swift)
files databases (although it is not recommended to use such loaded stateful applications in Docker very, very carefully)
Initially, Docker assumes that you just took the container, moved it anywhere - and it works.
Therefore, the answer is NO.
You are not using Docker for its intended purpose.
True, this does not mean that it is impossible to do this in any case. It's just that you may run into unexpected problems. For example, there was a question here recently - the author should use Docker in MacOSX to compile files. And it was the connected (mounted) folder that slowed down all the work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question