How To Run Python APIs on GCP Cloud Run

A step by step guide with an example project With Docker Runtime

Bhargav Bachina
Bachina Labs

--

If you want to develop and deploy highly scalable containerized applications on a fully managed serverless platform, GCP Cloud Run is the right choice. You can run the whole API with Docker runtime without any worry about the configuration from your side. GCP Cloud Run is a GCP service that you can write code your way by deploying any code or container that listens for requests or events. Build applications in your favorite language, with your favorite dependencies and tools, and deploy them in seconds.

You can select the Python runtime or you can dockerize the Python API and deploy that in the Docker runtime. The Docker images can be pulled from the Container registry, etc. In this post, we will see how to run Python API with Docker runtime.

  • Prerequisites
  • Install gcloud CLI and Configure
  • Example Project
  • Dockerize the Project
  • Running the API on Docker
  • Pushing Docker Image To Container Registry
  • Creating a Cloud Run Service
  • Testing The API
  • Application Logs
  • Deleting the Service

--

--