Deploying FastAPI Apps Over HTTPS with Traefik Proxy
HTML-код
- Опубликовано: 6 сен 2024
- Learn how to easily build a modern web API in Python with FastAPI and then deploy it to production with HTTPS, powered by Traefik, to serve all your cloud needs.
This session start swith a simple FastAPI application developed locally and end with it deployed on a remote DigitalOcean cloud server, properly secured and served with HTTPS using Traefik.
In this event you'll learn, step by step, how to:
* Create a simple FastAPI application, running locally.
* Create a Docker image for our application, using the official Docker images for FastAPI.
* Run and test it locally with Docker Compose.
* Set up a remote cloud server in DigitalOcean from scratch.
* Install and configure the necessary components.
* Configure the DNS records for the domain.
* Configure and set up Traefik in the cloud server.
* Add the necessary configurations to connect the FastAPI application with Traefik.
* Transfer, build, and deploy the application.
* Review how Traefik acquires and updates the certificates with Let's Encrypt.
* Check and ensure that HTTPS is working.
Q & A from the session: gist.github.co...
About Sebastián:
Sebastián Ramírez (@tiangolo) is the creator of FastAPI, Typer, and other open source tools.
For more about Traefik Labs visit: www.traefik.io
"THE MAN" HIMSELF OMG
Who best to explain Fastapi than the creator himself. ❤️
I'm honoured to be before you. God of Fastapi 🤗
Wowww...one if the best complete tutorials simplified and packed this one video. It's amazing all your explanations are just on point. 👌 I have come to understand so many concepts from docker, docker-composr, https, etc....👌👌👌
Now I started to make videos on Fast API and here is the creator 🙂
Do You know how to deploy fastApi in a cPanel shared server? Just want to know if that is possible
Nice Explanations! I didnt get my app working with traefik on a remote host with multiple other tutorials. Now it finally works, thanks alot
This is really useful! Thank you Sebastian! 🇨🇴
Super nice explanation! The best material and explanation on docker with traefik and basic api configuration!
thanks for this video, i finally got a grasp of docker and docker-compose. Great video overall.
This is the best tutorial ever!
Thanks for such tutorial... Gracias! It would be very useful to have a gist with the code used. Cheers,
He provides some resources here: dev.to/tiangolo/deploying-fastapi-and-other-apps-with-https-powered-by-traefik-5dik
Exelente video, Gracias por compartir! 😎
This is just what I needed, thank you :)
Amazing video thank you Sebastián!!
Great tutorial. Thanks a lot!
Thanks a ton,
Followed every step, but stuck with 404 error after adding traefik @38:00.
Can some one please please help if you came across this? I have been stuck on this for days
Please share your issues at the Community Forum. Thanks! community.traefik.io/
Thank you for sharing this, I didn't know traefik and FastAPI are that powerful. Is there a repo to the code used in this session?
He provides some resources here: dev.to/tiangolo/deploying-fastapi-and-other-apps-with-https-powered-by-traefik-5dik
21:00 I have never seen this use of haveged before. Can someone give me a little more information on why it's used in this context with docker-compose, and if it's still needed in 2023?
I'm very new to API development. I thought that I'll need an NGINX server to scale up the backend. Is Traefik a replacement for Nginx? Or should I add Nginx underneath this? Sorry if this is a noob question.
Why creating two docker-compose files? Wouldn't it be simpler to create all services (traefik, backend, etc) or am I missing something?
Docker-compose are scope bound, its like if you have 2 computers, 1 runs on port 80 on their ip, and the 2nd one also runs something on port 80. If you ran the same software on 1 computer 2 times on port 80, you can't do it.
Is there any repository for the project, I couldn't find it. Thanks.
hi, is an extension that u use to detect the virtual enviroment?
Is it possible to have something like mydomain.me for a website running on netlify, and then app.mydomain.me for my FastAPI application running on DigitalOcean? I don't know why but my API keeps going down randomly
Yes. I did this recently. create a subdomain record in your netlify DNS and have it point to the IP address of your VPS. set the rules on your router for the specific service you're routing to and that should do it.
Better!!!
Why not create a network with docker compose
Same question
00:23:24 - is it good practice to use `rsync` for production applications. I have seen people install git in the remote server and then clone repository, please confirm if someone knows, when to use `rsync` and `git clone` ?
Please feel free to ping Sebastian on Twitter: twitter.com/tiangolo
@Francisco Javier Lendinez Tirado Thank You for taking your time to resolve my query...
in my litle experience, you will have to deal with more credentials, copying the files you need to prod instead whole project content also leaves you more space in pro
how can I deploy FastAPI app on my own cpanel host ??
can you run this fastapi app in iis server?
Thanks
would you explain how to deploy FastAPI on cpanel?
Same question. Did You figure it out @Javad
Sebastian - I need 4 years experience with FastAPI to get a job. Can you help? /s
Looks like, FastAPI itself released in 2019.. How anyone will get 4 years experience ?
@@hackwithharsha5228 that was Sabastian’s problem too /s
@@ianrickey208 Yup, I have seen his tweet after your comment.. :)
- It was created in 2019. How come you have 4 years of experience?
- overtime
@@cristian-bull boss answer Cristian!