Scaling of docker in cloud and ci/cd with jenkins

Hello Guys,

Let me first brief you guys about our setup.

We have one docker machine and in that machine we have got 3 environment with two container each. Each environment consist of 1 tomcat and 1 mysql containers. The ec2 machine we are using for docker host is of 8 GB RAM and 4 CPU. These environments are used by three testers. Each environment for each tester.

I have configured jenkins and integrated docker with jenkins. So during the build process every-time I create a fresh tomcat container so that they will have a fresh instance to test.

I have configured apache as a reverse proxy which proxies to each tomcat container. For example we have abc.xyz.com, def.xyz.com, ijk.xyz.com.

Now the problems that I want to solve

  1. If suppose new tester joins our team then I will have to provide him a separate container environment, lets say lmn.xyz.com., but when I create this new environment. the performance of application starts to degrade. So how would I tackle this?

  2. Suppose our technical architect wants to check some changes in a new environment, then I will have to create one more temporary environment for him as well.

  3. It is not like every environment will run every time.

So basically I can solve this by creating one more docker machine and creating the new environment in that docker but I don’t want to create so many docker instances instead I want it to autoscale whenever there is an need of new environment and whenever we don’t that new environment.

In this scenarios I need your suggestion how would I proceed?

Regards,
AjayS