Running multiple dockers

I use an application that runs on three different dockers:

  • The first one is an HTTP-HTTP server with a REST API
  • The second is rabbitmq
  • The third is the worker

The whole application is launched using docker-compose up

Really simple :)

I would like to make it scalable and run several instances of this entire application (3 docker images) independently of the others, and then install a load balancer, for example haproxy, which will be redirected to one of the applications.

I saw what I can use docker-compose up --scale blablabla, however the problem is that I can scale the containers, but I really want the other “application” to be independent.

For example, if I want version 3 of the application, I will have 9 images of dockers, etc.

I saw that we can run docker inside docker using --privilege(letting me create one docker with three docker inside), but I read in Stack Overflow that this is not a suitable solution.

Do you have a solution? Or at least some documents to read.

I heard that Kubernetes might be the solution, but I'm not sure. I read (on the stack)

If you need several hard-bound containers, you can look at Kubernetes, which launches docker in its "containers"

+5
source share
2 answers

, 3 "" Compose, . , --project-name -p docker-compose. :

  • 1: docker-compose -p appv1 up -d
  • 2: docker-compose -p appv2 up -d
  • 3: docker-compose -p appv3 up -d

3 , . Docker Compose ( ) . , appv1_worker_1, appv2_worker_1, appv3_worker1. appv2 (docker-compose -p appv2 scale worker=2), appv2_worker_2.

compose , . 3 (appv1_default, appv2_default appv3_default).

, docker-compose.yml. , image: ${MYIMAGE} , - :

  • MYIMAGE=myorg/myapp:v1 docker-compose -p appv1 up -d
  • MYIMAGE=myorg/myapp:v2 docker-compose -p appv2 up -d

, Docker Compose.

+18

docker-compose , . compose - docker-compose1.yml docker-compose2.yml, docker, :

docker-compose -f docker-compose1.yml -f docker-compose2.yml up

0

Source: https://habr.com/ru/post/1677081/


All Articles