Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Example FastAPI Backend on GCP

ℹ️ Project Info

An example FastAPI backend that deploys to GCP Cloud Run using LaunchFlow.

This project will configure the following GCP resources in your GCP account:

NOTE: The GCP infrastructure is defined in infra.py

⚙️ Prerequisites

Install the requirements

pip install -r requirements.txt

NOTE: This will install the LaunchFlow Python SDK + CLI

Authenticate with GCP

gcloud auth application-default login

NOTE: You will need the Google Cloud SDK installed to authenticate with GCP

⚒️ Create your Infrastructure

Automatically find and create all infrastructure used in your code

lf create

Learn how the lf create command works in the CLI Reference Docs.

🏃 Run your Application (local)

Run the FastAPI application locally using Uvicorn.

lf run {your env} -- uvicorn app.main:app --reload

🚀 Deploy your Application (remote)

Automatically build and deploy the FastAPI application to GCP Cloud Run

lf deploy

Learn how the lf deploy command works in the CLI Reference Docs.

🧹 Clean up your infrastructure

Automatically delete all infrastructure used by your application.

lf destroy

Learn how this command works in the LaunchFlow Docs.

Learn how the lf destroy command works in the CLI Reference Docs.