Skip to main content
Question

How to secure FastAPI backend on Google Cloud Run with Docker?

  • Nov 27, 2026 12:57 AM UTC
  • 0 replies
  • 0 views

mebiseptino

Hi everyone, I'm Mebi from Indonesia

I'm building a public service app called Kampung Pintar with FastAPI and Docker, deployed on Google Cloud Run. 

My problem is: How do I secure my API endpoints and protect user data? I am worried about unauthorized access and exposing my environment variables.

I already tried using JWT for authentication and setting environment variables in Cloud Run, but I am not sure if that is enough for production.

What is the best practice for securing FastAPI on Google Cloud? Should I use Identity-Aware Proxy, Secret Manager, or API Gateway?

Thank you in advance!