Elixir application on Google Cloud Run with Cloud Build

Bruno Ripa
3 min readMay 26, 2019

In my previous article i have shown how to properly build an Elixir application using Distillery; now i’d like to show how to deploy it on Google Cloud Run, using Google Cloud Build.

What is Google Cloud Run ?

Google Cloud Run is a managed infrastructure that you can use to deploy your container and have it served as one (or more) serverless functions without the usual limitations. If you want to use Amazon Lambda functions or Google Cloud Functions must adopt one of the allowed runtime environments (most common ones are python, javascript, java, and few others), and so you implicitly must embrace all the characteristics of the chosen language.

Cloud Run instead tells you: “give me your container, do in it what you need, i’ll deploy and serve it for you”. This is an interesting chance to have the flexibility of lamba architectures without limits. Also, billing is per invocations, with also a pretty generous free tier.

And what about Google Cloud Build ?

Cloud Build executes your builds importing source code from sources like Google Cloud Storage, Cloud Source Repositories, GitHub, or Bitbucket, inject ingconfiguration bits and producing artifacts (so, docker images to deploy). It comes, at the moment, with 120 minutes/day of free build time. It can be orchestrated via a Dockerfile or a cloudbuild.yaml .

The deployment procedure

--

--

Bruno Ripa

Independent consultant | GDG Cloud London Organizer | GDGAcademy Mentor | Polyglot programmer