microapis
microapis
  • 26
  • 109 499
Running applications in Docker [2024] (Python + FastAPI example)
Run applications with Docker!
The code for this tutorial is available here: github.com/abunuwas/short-tutorials/tree/main/fastapi-docker
To follow along with the tutorial, please install Docker (www.docker.com/) in your system and follow the instructions to the get Docker daemon up and running. The Daemon must be running to be able to run Docker processes.
What is Docker? Docker is a virtualization technology that allows you to build lightweight images. Docker shares the kernel with the host machine instead of running its own kernel as traditional virtual machines do.
Say what...?
Let's put in simple terms: Docker is an engine that allows you to run your code in completely isolated environments. Docker builds are called images. When we run an application based on a Docker image, we create a container. Think of containers as instances of the image.
The great thing about Docker is that you can use the same build (image) and run it anywhere, so you get reproducible environments. You can get the same code that runs in production and run it in your machine. This is great for debugging and troubleshooting problems in production.
Docker images can be run on any platform that has a Docker engine, which allows us to replicate the same environment in production and in local. The process that runs off a Docker image is called a container.
This tutorial shows you how to dockerize a FastAPI application, but you can apply the same approach to any other Python application or applications from any other stack.
Let's go!
00:00 Introduction
01:39 Walk through the code
03:30 Installing dependencies and running the application
04:57 Install Docker
05:39 Creating a Dockerfile (touch Dockerfile)
13:37 Building a Docker image (docker build -t image:tag)
14:47 Listing Docker images (docker image ls)
15:35 Run the application as a Docker container (docker run)
17:56 Running the Docker container in the background (docker run -d)
18:24 docker ps (get a list of running Docker containers)
18:40 Step within a running Docker container (docker exec)
21:09 Stop Docker containers running in the background (docker ps + docker stop)
21:20 Run containers with a bash session
22:18 List all stopped containers (docker ps -a)
23:03 Resume execution of a stopped container (docker start)
24:22 Deleting stopped containers
25:31 Deleting a Docker image
26:05 Tutorial followups
26:54 Wrapup
#python #fastapi #render #devops #deployments #rdocker
มุมมอง: 397

วีดีโอ

Deploy with render.com tutorial (FastAPI example)
มุมมอง 9313 หลายเดือนก่อน
Deploy FastAPI applications to render.com! The code for this tutorial is available here: github.com/abunuwas/short-tutorials/tree/main/fastapi-render To follow along with the tutorial, please create an account with Render here: render.com/. I recommend signing in with GitHub to automatically link Render to your GitHub account. You don't need a paid subscription to follow the tutorial. How do yo...
Validate JWTs issued by Auth0 in FastAPI
มุมมอง 8534 หลายเดือนก่อน
Validate JSON Web Tokens (JWTs) issued by Auth0 in FastAPI To follow along with this tutorial, you need an account on auth0.com. Also make sure you follow all the steps in the previous videos: - "Setting up Auth0 for API Authentication and Authorization" (th-cam.com/video/PbUcQUQ7K2o/w-d-xo.html) to set up your Auth0 account - "Login and issue API access tokens with Auth0 and FastAPI" (th-cam.c...
Login and issue API access tokens with Auth0 and FastAPI
มุมมอง 2.6K4 หลายเดือนก่อน
Login and issue API access tokens with Auth0 and FastAPI To follow along with this tutorial, you need an account on auth0.com. Also make sure you follow all the steps in the previous video, "Setting up Auth0 for API Authentication and Authorization" (th-cam.com/video/PbUcQUQ7K2o/w-d-xo.html), since we'll use that set up to integrate FastAPI with Auth0. The code repository for this tutorial is a...
Setting up Auth0 for API authentication and authorization
มุมมอง 4.4K4 หลายเดือนก่อน
Setting up Auth0 for API authentication and authorization. To follow along with this tutorial, you'll need to create an account on auth0.com. Go with the free tier. You won't need paid features for most applications. Login, user registration, managing sessions, issuing access tokens... these are some of the most complex things when building a new web service or an API. For junior developers, it...
Git tutorial for beginners [2024]
มุมมอง 805 หลายเดือนก่อน
Git is the most popular and widely used source control management tool. If you're a developer, you probably use git. And if you're not using it, you should! The problem is, in my experience, most developers are not familiar with Git. And this is a big blocker in their work. Becoming a proficient Git user is fundamental for any software developer, so I thought I'd put this short tutorial togethe...
FastAPI severless deployments on AWS
มุมมอง 5715 หลายเดือนก่อน
The GitHub repository for this video is here: github.com/abunuwas/short-tutorials/tree/main/fastapi-serverless What's the best way to deploy a FastAPI application? I hear the question a lot. The truth is, there are many different ways to deploy a FastAPI application! When looking for a deployment model, we have to look at 3 parameters: 1) Cost 2) Scalability 3) Easy of deployment The first para...
Create IAM users on AWS with temporary credentials (the right way)
มุมมอง 5535 หลายเดือนก่อน
Do you have an AWS account? Are you adding users directly through IAM? If that's your case, watch this video! Traditionally, we'd add users to AWS accounts through the IAM service. We'd log in directly to the account using those profiles, and we'd create AWS access keys for the CLI. This way of managing access to AWS is deprecated and highly insecure. Why? Because those AWS access keys are long...
Create custom middleware with FastAPI
มุมมอง 1.1K5 หลายเดือนก่อน
Create custom middleware with FastAPI The code for this tutorial is available on GitHub: github.com/abunuwas/short-tutorials/tree/main/fastapi-middleware What is middleware? Middleware is a layer that pre-processes requests in web servers. Before a request reaches our controllers, i.e. the functions that implement endpoints/URLs in our API, there's a pre-processing stage. In that stage, the fra...
API pagination with FastAPI and SQLAlchemy
มุมมอง 2.9K10 หลายเดือนก่อน
Pagination is the ability to sequence a collection of items into smaller chunks. For APIs, pagination is incredibly important to safeguard the health of our services. Imagine you have a very large collection of items in your database (millions of records). If you were to return the whole collection to every user in a single fetch, that would put tremendous pressure on your system and cause perf...
Build APIs with Flask (the right way)
มุมมอง 13K10 หลายเดือนก่อน
Flask is a hugely popular Python web development framework. Tons of websites are built with Flask, and tons of them contain APIs. I've had the privilege to work with many companies building APIs with Flask, I've seen some common errors and anti-patterns, and I've put together a bunch of best practices. This video teaches you how to avoid some common mistakes when building APIs with Flask and ho...
API Security Fundamentals [2023]
มุมมอง 1.8Kปีที่แล้ว
API Security Fundamentals [2023]
Build APIs with Python [workshop]
มุมมอง 2.5K2 ปีที่แล้ว
Build APIs with Python [workshop]
Using the Repository Pattern for better data access encapsulation (in Python)
มุมมอง 12K2 ปีที่แล้ว
Using the Repository Pattern for better data access encapsulation (in Python)
FastAPI with SQLAlchemy Tutorial
มุมมอง 14K2 ปีที่แล้ว
FastAPI with SQLAlchemy Tutorial
FastAPI with JWT auth tutorial
มุมมอง 7K2 ปีที่แล้ว
FastAPI with JWT auth tutorial
FastAPI Tutorial
มุมมอง 2.5K2 ปีที่แล้ว
FastAPI Tutorial
Working with JWTs in Python
มุมมอง 7K2 ปีที่แล้ว
Working with JWTs in Python
Introducing Microservice APIs
มุมมอง 3642 ปีที่แล้ว
Introducing Microservice APIs
Setting up Alembic with SQLAlchemy
มุมมอง 34K2 ปีที่แล้ว
Setting up Alembic with SQLAlchemy
PyCon India 2021
มุมมอง 2053 ปีที่แล้ว
PyCon India 2021

ความคิดเห็น

  • @SamsonJudea
    @SamsonJudea วันที่ผ่านมา

    Thank you. Simple and sweet. Easy step by step

  • @dmytronice1337
    @dmytronice1337 8 วันที่ผ่านมา

    Thanks for video, but I don't understand, should I create my own API ( I mean API resource inside Auth0 dashboard). Because right now I don't see need and not clearly understand. I have an Admin app with React and iOS app with content and backend On UI I authorize through password grant via Authentication Auth0 API, on backend side I just validate the ID token to access resources of my API Why to create API inside auth0 dashboard?

  • @manikandanp3708
    @manikandanp3708 15 วันที่ผ่านมา

    Very helpful thank you

  • @giorgioripani8469
    @giorgioripani8469 หลายเดือนก่อน

    Your coverage is below 20% 😮

  • @giorgioripani8469
    @giorgioripani8469 หลายเดือนก่อน

    Why do you call _id a class property instead of a private property?

  • @moiattube
    @moiattube หลายเดือนก่อน

    Very clear explanation. I just miss the explanation of a change in the data model, so you had shown the power of alembic. Anyway, thank you a lot for this introduction

  • @RicardoGarciaM
    @RicardoGarciaM หลายเดือนก่อน

    Hola Jose, thank you for your video. As a .NET developer currently working with Python, I feel uneasy when I see global dependencies, loosely typed parameters... I find your more professional demos to be particularly useful. Have a question: could you explain the purpose of the RepositoriesRegistry? I'm wondering if it would be possible to simply pass the BookingsRepository as a parameter instead of creating a RepositoriesRegistry. What is the benefit of using RepositoriesRegistry in this context?

  • @jcatstreams8550
    @jcatstreams8550 2 หลายเดือนก่อน

    It’s not repository pattern, it’s trash, gl

    • @microapis
      @microapis 2 หลายเดือนก่อน

      Happy to help if you have any questions or difficulties understanding how it works!

    • @jcatstreams8550
      @jcatstreams8550 2 หลายเดือนก่อน

      @@microapis u need to read Martin Fowler, why u try to teach someone?

    • @microapis
      @microapis 2 หลายเดือนก่อน

      @@jcatstreams8550 Fowler is a good start, but it only scratches the surface. To learn more about repositories, check out Eric Evan's "Domain-Driven Design". In addition to reading these books, I always recommend to work through the examples, and to think of how to apply them to different situations. Again, if you have any questions or difficulties working out the repository pattern I'm here to help!

  • @ttaylor9916
    @ttaylor9916 2 หลายเดือนก่อน

    Would be great if you showed the imports whenever you added one... i was importing fields incorrectly... also having code would be great :)

  • @mrtglcn
    @mrtglcn 2 หลายเดือนก่อน

    In one of my projects, I added a middleware to check a header value (like an API KEY value) and blocked the requests if value was not validated. Is it a right approach to authorize requests to our API?

  • @MartinBlaha
    @MartinBlaha 2 หลายเดือนก่อน

    I really appreciated the way how you explain. Thank you. It came at the right time that I stumbled into your video.

  • @AlexTechProjects
    @AlexTechProjects 2 หลายเดือนก่อน

    Good. Alex Tech Projects

  • @fanny-ml-gameplay
    @fanny-ml-gameplay 3 หลายเดือนก่อน

    Thank you, this is very helpful. One thing is that I don't see Groups. Is there a feature for Groups? I only see Users, Roles and Permissions but it seems Groups is missing. Also I saw someone saying about Authorization Extension, have you tried that? Does it work? That extension seems to have Groups but I'm not sure if it works.

  • @allalonetech
    @allalonetech 3 หลายเดือนก่อน

    Thats cool Now it feels like we are a real developers will share resources for what to do next Thanks, keep up ❤

    • @microapis
      @microapis 3 หลายเดือนก่อน

      Thank you @allalonetech 🙌!! I have more Docker videos coming up, about SQLAlchemy, Django, GraphQL, and API security 🚀🚀

    • @allalonetech
      @allalonetech 3 หลายเดือนก่อน

      @@microapis we need FastApi first

  • @microapis
    @microapis 3 หลายเดือนก่อน

    Thanks for watching! Don't forget to like and subscribe! What other topics would you like me to over in future videos?

  • @아폴론-s4b
    @아폴론-s4b 3 หลายเดือนก่อน

    Your presentation is always helpful for me. Thank you so much!

    • @microapis
      @microapis 3 หลายเดือนก่อน

      Thank you for your kind comment 🙏! I'm really glad to hear you find the content helpful 🙌!

  • @vladyslavprykhodko2155
    @vladyslavprykhodko2155 4 หลายเดือนก่อน

    Hello, I am currently learning FastAPI and Python after working as an Android developer for 6 years. Your channel is very helpful to me, thank you! Could you please cover the topic of deploying on AWS? For example, I have FastAPI and Celery, and I'm finding it difficult to figure out how to deploy them on AWS Lambda. Right now, I am using a regular VPS for hosting, but it is expensive for me, especially when my server is not under load.

    • @microapis
      @microapis 3 หลายเดือนก่อน

      Hi sorry for my late reply! I have a tutorial about deploying FastAPI applications to AWS serverless: th-cam.com/video/CTcBLrR32NU/w-d-xo.html. Deployment is straightforward and works fairly well for most use cases. The only thing to bear in mind about AWS serverless is that you'll have a max timeout of 30 seconds and the process will exit after that. Only question is how are you using Celery? Is it for long-running background tasks?

    • @vladyslavprykhodko2155
      @vladyslavprykhodko2155 3 หลายเดือนก่อน

      @@microapis Thank you for the response! Yes, my background task takes a long time, from a few minutes to an hour. I generate images for my content using OpenAI.

    • @microapis
      @microapis 3 หลายเดือนก่อน

      ​@@vladyslavprykhodko2155 sorry for my late reply! Background tasks won't do well in serverless since the whole process will exist as soon as the API returns or times out. In this setup, I'd recommend using an SQS queue to manage the tasks and a separate Lambda to process those tasks asynchronously. That way, the asynchronous Lambda will have up to 15 minutes to do the job. If what you're doing is generating images, you can upload those images to s3 and you can serve them from there. All of those would be fairly cheap to operate since the Lambdas only run when needed and s3 costs are minimal for a task like this

  • @microapis
    @microapis 4 หลายเดือนก่อน

    Thanks for watching! Don't forget to like and subscribe! Did you deploy something after following this tutorial? Share the link with in the comments! What other topics would you like me to cover in future tutorials?

  • @DanA-n1w8t
    @DanA-n1w8t 4 หลายเดือนก่อน

    Hey man, thanks for your work. Im spinning up a personal project and i chose Flask for the RESTapi. This video is perfect, thank you. Subbed btw haha

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you I'm so glad you found it useful 🙌! Flask is an excellent choice and very powerful when used properly. Good luck with your project and feel free to reach out if you have any questions!

  • @pavelepanov
    @pavelepanov 4 หลายเดือนก่อน

    And I'am sorry, can we talk about programming in some messangers? Like Discord I want create project with react and fastapi, but i don't understand how i can do it

    • @pavelepanov
      @pavelepanov 4 หลายเดือนก่อน

      with auth0 i don't understand))

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Sure! Feel free to ping me on Discord, my handle is @joseharoperalta. I've also created a Discord community for people interested in APIs, feel free to join if you'd like to: discord.gg/fCjxmfJv

  • @pavelepanov
    @pavelepanov 4 หลายเดือนก่อน

    Hi! Great videos of theme auth0. Can u create simple project with auith0? I want to see how i can use rbac with endpoints in fastapi. In my mind okta's docs is not userfriendly((

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Hi Pavel thank you for your kind words! That's a great idea I'll put together an example of using RBAC in an API!

  • @MrCockfield
    @MrCockfield 4 หลายเดือนก่อน

    Thanks for the video, does this work with the standard /callback flow that they talk about? I'm finding with my own implementation, I'll redirect to the auth0 page, user will sign up, and then on the callback I will get a CSRF issue because there is no persistence with the sessions

  • @henrikdjurestal6947
    @henrikdjurestal6947 4 หลายเดือนก่อน

    Great video! Thanks for this, life saver

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you for your kind words 🙏! Really glad to hear you found it useful 🙌🙌!

  • @아폴론-s4b
    @아폴론-s4b 4 หลายเดือนก่อน

    Your lecture is very useful for me. Thank you so much.

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you for your comment I'm really glad to hear you found it helpful 🚀!

  • @microapis
    @microapis 4 หลายเดือนก่อน

    Thanks for watching! Don't forget to like and subscribe! What other topics would you like me to cover?

  • @iceicehon4044
    @iceicehon4044 4 หลายเดือนก่อน

    the best

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you 🚀🚀!!

  • @iceicehon4044
    @iceicehon4044 4 หลายเดือนก่อน

    cant believe this is free....

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Trying to help as many people as possible 😄!

  • @iceicehon4044
    @iceicehon4044 4 หลายเดือนก่อน

    appreciate of your working!

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you 🙌!

  • @iceicehon4044
    @iceicehon4044 4 หลายเดือนก่อน

    THANK YOU! so much love from Korea ㅜㅜ

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you for your kind words 🙏🙏! Will be in Korea 🇰🇷 in September, looking to arrange an API security workshop!

  • @ExperiencePlusDigital
    @ExperiencePlusDigital 4 หลายเดือนก่อน

    Fantastic video, easy to follow and straightforward process that builds on the each previous step. Looking forward to the next video in the series. Thank you for this video José! Danny

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you for your supportive comment Danny 🙌!! Aiming to post the next video later this week 🚀🚀!!

  • @yak0315
    @yak0315 4 หลายเดือนก่อน

    Good video, straight to the point and easy to understand, I will be waiting for more videos about the authorization flow more specifically about the use of refresh tokens and logout.

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you for your kind comment and for the suggestions 🙏!! I have those videos in the pipeline for the coming weeks 🙌!

  • @microapis
    @microapis 4 หลายเดือนก่อน

    Thanks for watching! Don't forget to like and subscribe! Let me know in the comments what other topics you'd like me to cover in future videos!

  • @self.improved
    @self.improved 4 หลายเดือนก่อน

    Really nice video, and I appreciate your experiential knowledge. This is something that isn't easy to find.

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thank you for your kind words 🙏! This is the exact reason why I created this channel 🚀🚀!

  • @Juny-j1m
    @Juny-j1m 5 หลายเดือนก่อน

    Thanks for your video

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thanks for your support 🙌!

  • @아폴론-s4b
    @아폴론-s4b 5 หลายเดือนก่อน

    Thank you so much.

    • @microapis
      @microapis 4 หลายเดือนก่อน

      Thanks for your support 🙌!

  • @microapis
    @microapis 5 หลายเดือนก่อน

    Thanks for watching! Don't forget to like and subscribe! What other topics would you like me to cover in future videos?

    • @ankitpatil5231
      @ankitpatil5231 4 หลายเดือนก่อน

      Great video an Example with springboot would be helpful

    • @microapis
      @microapis 4 หลายเดือนก่อน

      @@ankitpatil5231 Thank you for your support and your suggestion 🙌! I'll look into putting together a tutorial as soon as I can!

  • @KelvinMeeks
    @KelvinMeeks 5 หลายเดือนก่อน

    Very nice.

    • @microapis
      @microapis 5 หลายเดือนก่อน

      Thank you Kelvin 🙌!

  • @somedayitsgonnamakesense
    @somedayitsgonnamakesense 5 หลายเดือนก่อน

    so can I implement this IAM Identity Center to limit the number of servers and databases the user can access using permission sets right? my company wants to properly implement strict measures on who and when some devs/data engineers can access some resources.

    • @microapis
      @microapis 5 หลายเดือนก่อน

      Thanks for your question! Permission sets are collections of IAM policies. With IAM policies, you can be absolutely granular on how users can access resources. So you can create a policy that gives read-only access to a specific S3 bucket, or a certain path within that bucket. Another policy with specific permissions to an EC2 instance or an RDS database, and so on. Then you can bring those policies together under a permission set. Is that the kind of access control you're looking for?

  • @microapis
    @microapis 5 หลายเดือนก่อน

    Thanks for watching! Don't forget to like and subscribe!

  • @아폴론-s4b
    @아폴론-s4b 5 หลายเดือนก่อน

    I think your performance is outstanding. It will be great help to me. Thank you so much.

    • @microapis
      @microapis 5 หลายเดือนก่อน

      Thank you for your kind comment and your support 🙌!

  • @Juny-j1m
    @Juny-j1m 5 หลายเดือนก่อน

    Thanks for your efforts. That'll be helpful for us.

    • @microapis
      @microapis 5 หลายเดือนก่อน

      It's my pleasure thank you for your comment 🙌!

  • @digitallova
    @digitallova 5 หลายเดือนก่อน

    Thanks for everything

    • @microapis
      @microapis 5 หลายเดือนก่อน

      Thank you for your support 🙌!

  • @microapis
    @microapis 5 หลายเดือนก่อน

    Thank you for watching! Don't forget to like and subscribe!

  • @microapis
    @microapis 5 หลายเดือนก่อน

    Thanks for watching! Don't forget to like and subscribe!

  • @leovasco63
    @leovasco63 5 หลายเดือนก่อน

    this explain is a joke? do you mean a program that are PROGRAMED DÃ to answer without a response of the home server from the "page". yes economy data sharing = only download, no upload. _l_ that would not be fake avertising from server providers?

    • @microapis
      @microapis 5 หลายเดือนก่อน

      Not sure if you’re commenting on the right video but to clarify this is a video about middleware, specifically about web middleware. Middleware is a layer of software that sits between the receiving end of your server and your controllers and allows you to apply various processing steps on each request

  • @microapis
    @microapis 5 หลายเดือนก่อน

    Thank you for watching! What other concepts would you like me to explain?

  • @GeorgeKer
    @GeorgeKer 5 หลายเดือนก่อน

    thank you

  • @mlsandreas
    @mlsandreas 5 หลายเดือนก่อน

    Thank you!

  • @microapis
    @microapis 5 หลายเดือนก่อน

    Thank you for watching!

  • @rafaelfurquim745
    @rafaelfurquim745 6 หลายเดือนก่อน

    Thank you very much, you help me a lot! Congrats for this video.

    • @microapis
      @microapis 5 หลายเดือนก่อน

      Thank you for your kind comment @rafaelfurquim745 🙌!