Chapter 10: Deploying a FastAPI Project
Building a good application is great, but it's even better if customers can enjoy it. In this chapter, you'll look at different techniques and the best practices for deploying your FastAPI application to make it available on the web. First, you'll learn how to structure your project to make it ready for deployment by using environment variables to set the configuration options you need, as well as by managing your dependencies properly with pip
. Once done, we'll show you three ways to deploy your application: with a serverless cloud platform, with a Docker container, and with a traditional Linux server.
In this chapter, we're going to cover the following main topics:
- Setting and using environment variables
- Managing Python dependencies
- Deploying a FastAPI application on a serverless platform
- Deploying a FastAPI application with Docker
- Deploying a FastAPI application on a traditional server ...