In the previous chapters, you learned how to build a web service and a web application using Rust. We also looked into async programming and even addressed the P2P architecture. We tested our applications in a local development environment. But these are only the first steps. The ultimate goal is usually to deploy in a production environment.
In this last chapter, we will focus on packaging the software using a popular method of production deployment called containerization. It involves packaging the application’s components and its dependencies in a container. This container can then be deployed on multiple environments, including the cloud. One of the advantages of using containers is that the application remains cleanly separated from other containers, avoiding the risks of incompatible libraries.
We’ll take a detailed look at the steps needed to containerize our Rust web service. Once the web service is available as a Docker container, it is no different from any web service or application written in any other programming language from a production deployment standpoint. All the standard guidelines and options for deploying Docker containers will apply.