Google Cloud Run is one of the fast and scalable solution for your API deployment over secure https connection and can be considered as first choice of every developer. Well firebase is for static websites, right? What if we can deploy Dynamic websites on firebase too? All you need is
Cloud Run. Here, in this tutorial we will be showing you how you can deploy a simple website on Cloud Run. we will be using
Flask for the website. First set-up your system with Google Cloud SDK. If you don't know how to do it I recommend you read through their official documentation
here.
Enable Cloud Run API
Next you need to enable the
Cloud Run API.
Creating the project
Now the fun part begins. Let's get to the code.
Deploy the project
Now your project is ready to be deployed. To deploy it to Google Cloud Run, we need to containerize the project and the container to Google Container Registry (gcr).
Let's see how it can be done.
Output-
If you have done all the steps correctly then, your Cloud Run page should look something like this
👁 Final Cloud Run
Congratulations! You have just deployed an application packaged in a container image to Cloud Run. Cloud Run automatically and horizontally scales your container image to handle the received requests, then scales down when demand decreases.