This event is hosted by Atharva Malode and Aayush Paigwar. It will guide you through deploying backend services using FastAPI, Docker, and Microsoft Azure. The session will be particularly useful for learning how to deploy machine learning models and scalable backends on Azure.
- Phase 1: Learn about FastAPI and how to deploy it on
localhost:8000
. - Phase 2: Cover topics such as Docker and deployment on Docker Hub.
- Phase 3: Conclude with deployment on Microsoft Azure with the help of VS Code.
- Download the zip file from JARVIS GHRCE GitHub account
- Extract the files and open a new folder in Visual Studio Code
- Install the required dependencies using
requirements.txt
- Run the FastAPI code and generate the link on port 8000
- Download Docker Desktop and keep it running till the program is terminated
- Create a new image in Docker and specify its version
- Deploy this image in a container on Docker Hub or on Azure
-
Download the Git file as zip or clone the repo
Visit the JARVIS GHRCE GitHub repository and download the project zip file or clone the repository.
-
Open Visual Studio Code
Open the extracted folder in Visual Studio Code by selecting
File > Open Folder
and navigating to the extracted folder. -
Install requirements in the terminal
Open the terminal in VS Code by selecting
Terminal > New Terminal
. Run the following command to install the required dependencies:pip install -r requirements.txt
-
Run fastAPI Application
uvicorn app.main:app --reload
-
Click on the link generated and open in new tab link for example: http://127.0.0.1:8000 add /docs on the new tab while opening
-
Terminate the link by using clrt+C
-
Open DockerFile in VS Code
-
Keep the Docker Deskstop open while running the program
-
Build Docker Image
docker build -t jarvis:v1 . docker run -p 8000:8000 jarvis:v1
- Login to Azure website and create a container
- Return to terminal and execute
az acr login -n <your-registry-name> docker tag jarvis:v1 <your-registry-name>.azurecr.io/jarvis:v1
- Push and run the container
docker push <your-registry-name>.azurecr.io/jarvis:v1
- Congratulations the deployment of FastAPI using Docker and Azure is completed!
You can contribute to the repository by making sample API calls in your preferred programming language and submitting them in the test-your-api-in-different-languages
folder.
-
Fork the Repository
Fork the JARVIS GHRCE GitHub repository to your own GitHub account.
-
Clone the Forked Repository
Clone the forked repository to your local machine:
git clone https://github.com/<your-username>/JARVIS-GHRCE.git
-
Make changes and raise a Pull Request.