Shipping and running the Docker container on the cloud
We will rely on AWS for our cloud requirements. We will use two of AWS’s free offerings for our purpose:
- Elastic Container Registry (ECR): Here, we will store our Docker image.
- EC2: Here, we will create a Linux system to run our API Docker image.
In this section, we will focus only on ECR. Here is a high-level overview of the steps we will follow to push the Docker image to the cloud:
- Configure AWS on the local machine.
- Create a Docker repository on AWS ECR and push the
sdd:latest
image. - Create an EC2 instance.
- Install dependencies on the EC2 instance.
- Create and run the pushed Docker image in step 2, on the EC2 instance.
The code in the following sections is also summarized as a video walkthrough here: https://tinyurl.com/MCVP-FastAPI2AWS.
Let’s implement the preceding steps, starting with configuring AWS in the next section.
...