You can use the following command to scale the container of a particular service:
$ docker-compose scale [compose container name]=3
Consider the following example:
$ docker-compose scale account=3
Let's see the following output:
As you can see, our account container now has three instances. But there is a problem here: how will a client call an instance of account-service since their ports have changed?
There are some solutions available to solve this issue, such as Kubernetes and AWSs' ECS. We'll discuss Kubernetes in the next section, and deployment with AWSs' ECS in Chapter 14