Deploying with Docker on Google Cloud Run which is a managed platform that enables you to run stateless containers that are invocable via web requests or Pub/Sub events.
In another project based on a real-world scenario, I acted as a Google Cloud Engineer to use Google Cloud Run to deploy QuickServe API’s application. Ensure the solution utilizes Cloud Run’s ability to automatically scale and manage infrastructure, providing a resilient and efficient environment for the application.
Google Cloud Run which is a managed platform that enables us to run stateless containers that are invocable via web requests or Pub/Sub events. It is fully managed by Google Cloud, offering automatic scaling, high availability, and secure deployments. Cloud Run abstracts away all infrastructure management, so we can focus on building the applications.
Key Features of Google Cloud Run:
- Fully Managed: Google Cloud manages the infrastructure, including provisioning, configuring, and scaling the servers.
- Automatic Scaling: Cloud Run automatically scales your application up and down, even to zero, depending on traffic.
- Stateless Containers: Designed for stateless HTTP containers, optimized for web applications and APIs.
- Integrated Logging and Monitoring: Integrated with Google Cloud’s operations suite for monitoring, logging, and diagnostics.
Below are the screenshots:
Open Cloud Shell
Create the two files necessary — sample python application to simulate the api and the docker file
app.py
Dockerfile
Search for Artifact Registry
Enable the api for the Artifact Registry
Create the repository
Repository created
Build the docker, set the project on google cloud shell, tag the docker image, authenticate the docker and finally push docker image to docker
Open Cloud Run(container orchestration service like Kubernetes) and create service to run container
Cloud Run is going to artifact registry, download the image that we just created and use this image to deploy the instance with the api to use it over the internet with the endpoint url to connect on mobile/web app
The api is running on the Google Cloud managing the infrastructure and scaling with any number of api calls.