A to Z: Deploying a Flask App Online Using Google Cloud Run

Alexistats
1 min readAug 19, 2023

--

You built a cool app using Python and Flask, but deploying looks like another mountain of work? Don’t fret, here is a series of small, step by step documentation to deploy a Flask based web-app for very cheap.

This guide is intended as a detailed reminder for myself to save time in the future, and hopefully save time for others as well.

The tools and services we will use are:

  • Gitlab
  • Docker
  • Google Cloud Run
  • Google Cloud Artifact Registry
  • A Domain service of your choice

Before deploying, you will require:

  • An app built in Python/Flask
  • A domain name (optional)

After those two things are acquired, we can get in the meat of things:

  1. Connect your local project to Gitlab
  2. Dockerize your Application
  3. Deploy the App on Google Cloud Run using Artifact Registry
  4. Map your Custom Domain to your Google Cloud Run service
  5. Using Gitlab to deploy your App to Google Cloud Run service directly (TBD)

Bonus:

  • Clean virtual environment of undesired packages
  • Setting up Google Cloud Account (??)

--

--

Alexistats

I am a data analyst with a math background, and I love hockey!