Marvix
By:
Marvix

Would please clear this, Docker or Nginx Server Blocks ?

July 30, 2017 182 views
Nginx Docker Ubuntu 16.04

Hi,

I just moving from shared host to here, I have 4 small WP sites, I need to host them in one droplet, I googled a lot, and got too many answers with many versions, I thought most of them are out dated.

So, I know that I can create virtual host with Nginx/Apache, but I came to know about Docker, and that confusing me, I do not need different DB and environment for each site since am the owner for all the sites, so should use docker, and virtual host will good for me?

Thanks,

3 Answers

@Marvix

Docker is used to package an application and all its dependencies in one package called docker image which can be ran on any Linux machine and get your application up and running, it could be used to create development environments and also it can be used in production environment too with help from tools such as Kubernetes.

In your case, if your different sites do not have conflicting dependencies and all of them use the same version of PHP and all of its extensions then it is safe to host them using virtual hosts, however if you would like more control over the PHP version used in each one and all its dependencies then you can create multiple docker containers and host your code in each one of them separately and at the same time use nginx reverse proxy to serve your application from each docker container on a specific port.

Hope this helps.

Great, this cleared the picture. However, using Docker would require more RAM and CPU to setup the environment, right? Becuase I just set it up MySQL, and it takes around 150Mb of the 500.

Thanks

Thank you for being helpful.

Have another answer? Share your knowledge.