Testing the API
To test the API for readiness, we will perform the following steps:
- Let's start by building the Docker image. For this, a prerequisite is to have Docker installed. Go to your terminal or Command Prompt and clone the repository to your desired location and access the folder
08_API_Microservices
. Execute the following Docker command to build the Docker image:docker build -t fastapi .
Execution of the
build
command will start building the Docker image following the steps listed in the Dockerfile. The image is tagged with the namefastapi
. After successful execution of thebuild
command, you can validate whether the image is built and tagged successfully or not using thedocker images
command. It will output the information as follows, after successfully building the image:(base) user ~ docker images  REPOSITORY  TAG      IMAGE ID      CREATED     ...