Python FastAPI Tutorial (Part 19): Deploy with Docker - Serverless Containers and Custom Domain
In this video, we'll be learning how to deploy our FastAPI application using Docker and Google Cloud Run. We'll containerize our app by writing a multi-stage Dockerfile, set up a serverless PostgreSQL database with Neon, deploy our container to Cloud Run, and configure a custom domain with HTTPS. We'll also add security headers to our application through middleware. This is a different approach from the VPS deployment in the previous video, where instead of managing our own server, Google handles the infrastructure for us and our app can scale to zero when nobody's using it. Let's get started...
The code from this video can be found here:
https://github.com/CoreyMSchafer/FastAPI-19-Deployment-Docker-GCR
Full FastAPI Course:
https://www.youtube.com/playlist?list=PL-osiE80TeTsak-c-QsVeg0YYG_0TeyXI
Docker Desktop:
https://www.docker.com/products/docker-desktop/
Create a New Google Cloud Project:
console.cloud.google.com/projectcreate
Google Cloud SDK:
https://cloud.google.com/sdk/docs/install
NameCheap (with Referral):
https://namecheap.pxf.io/nyBgR
Google Search Console:
search.google.com/search-console/
✅ Support My Channel Through Patreon:
https://www.patreon.com/coreyms
✅ Become a Channel Member:
https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join
✅ One-Time Contribution Through PayPal:
https://goo.gl/649HFY
✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey's Public Amazon Wishlist
http://a.co/inIyro1
✅ Equipment I Use and Books I Recommend:
https://www.amazon.com/shop/coreyschafer
▶️ You Can Find Me On:
My Website - http://coreyms.com/
My Second Channel - https://www.youtube.com/c/coreymschafer
Facebook - https://www.facebook.com/CoreyMSchafer
Twitter - https://twitter.com/CoreyMSchafer
Instagram - https://www.instagram.com/coreymschafer/
#Python #FastAPI
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
More on: Systems Design Basics
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Building the Backend for a Spatial Memory Network: Lessons from the Trenches
Dev.to · KevinTen
OOPs Concepts Explained — The Way Nobody Taught You in College
Dev.to · Priyanka Rakshit
Project, Don't Embed: Introducing Virtual Frame
Dev.to · Viktor Lázár
The “Nit” Comments That Hide Massive Architectural Debt
Medium · Programming
🎓
Tutor Explanation
DeepCamp AI