concept production deployment in category docker

This is an excerpt from Manning's book Bootstrapping Microservices with Docker, Kubernetes and Terraform.
If you already know Node.js then you’ll find much of this chapter to be familiar and you might be tempted to skip it, but please still skim through it because there are some important notes on setting up your development environment, preparing for production deployment and getting ready for fast iterative development that we’ll rely on throughout the book.
Docker in development:

This is an excerpt from Manning's book Learn Docker in a Month of Lunches.
Lastly, this book is specifically on Docker, so when it comes to production deployment I’ll be using Docker Swarm, the clustering technology built into Docker. In chapter 12 I’ll talk about Kubernetes and how to choose between Swarm and Kubernetes, but I won’t go into detail on Kubernetes. Kubernetes needs a month of lunches itself, but Kubernetes is just a different way of running Docker containers, so everything you learn in this book applies.
These are the basic properties you’d want to include for a production deployment. Running multiple replicas means your app can manage more load, and it also means one replica will be available to serve traffic if the other goes offline because of a server failure or a service update. You should also specify compute limits for all your services when they go live, to protect your cluster from a rogue replica consuming all the processing power and memory. Working out the limits takes some effort, because you need to know the amount of CPU and memory your app needs when it’s working hardest--metrics like those we saw in chapter 9 help with this. The resource limits in this application specification restrict each replica to a maximum of 50% of one CPU core and 100 MB of memory.