Containerizing Python web apps with Docker, Flask, Nginx & uWSGI

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024

ความคิดเห็น • 196

  • @subhadippahari1244
    @subhadippahari1244 4 ปีที่แล้ว +1

    nothing to say, except mind-blowing content and teaching style. I try to find this for weeks, at last, got it. keep it up, man.

  • @acortis
    @acortis 5 ปีที่แล้ว +24

    Hello there, great videos (saw the entire series), definetely underrated channel. Keep it up bro.

  • @ericli8461
    @ericli8461 5 ปีที่แล้ว +3

    Very awesome tutorial!! I have checked over many online docs or videos regarding dockerizing the flask & nginx application. Yours is by far the most easy-to-follow and clearly structured one. Thanks!

  • @DorZ1983
    @DorZ1983 2 ปีที่แล้ว

    Best tutorial video I've watched on these subjects. thank you for that.

  • @SamAndrew27
    @SamAndrew27 2 ปีที่แล้ว

    Best Docker & Flask tutorial I've found! Thanks dude :D

  • @hotharvey2
    @hotharvey2 3 ปีที่แล้ว

    on par with the legend Corey Schafer here. Really helped me nail the overall idea and implementation of docker-compose. Will be donating to you once I get a job lol

  • @BiranchiNarayanNayak
    @BiranchiNarayanNayak 4 ปีที่แล้ว +6

    Can you please make another video on how to run multiple python apps on Docker running on different ports ?

    • @scoa_dev8551
      @scoa_dev8551 4 ปีที่แล้ว

      Biranchi Narayan Nayak Just make a new app then port it port 3000 and just reference it.

  • @zenahrb8316
    @zenahrb8316 4 ปีที่แล้ว

    got yourself a new sub. Absolutely stunning delivery!

  • @solrachincapie
    @solrachincapie 2 ปีที่แล้ว

    Excelente Julian... Muchas gracias me ayudaste bastante...

  • @angshumanbardhan3729
    @angshumanbardhan3729 2 ปีที่แล้ว

    Thank You for making this video

  • @srir7249
    @srir7249 3 ปีที่แล้ว

    This is such a great video.
    Would you also be able to explain how a container would be able to write into a database server.

  • @fortis-lt
    @fortis-lt 4 ปีที่แล้ว

    You help me well! Thank you for the guide!

  • @roberthmejias
    @roberthmejias 4 ปีที่แล้ว

    Awesome!!! its so great, this one works for me ... thanks so much

  • @leemerchant9231
    @leemerchant9231 3 ปีที่แล้ว

    Seriously good video. Thanks!

  • @noli-timere-crede-tantum
    @noli-timere-crede-tantum 5 ปีที่แล้ว +3

    Thanks for the video. Small clarification: one does not build "containers"; one builds "images" which can be ran as containers. #languageIsKey

    • @cartmanhz
      @cartmanhz 4 ปีที่แล้ว

      Exactly, containers built with
      docker run or create.

  • @felixmeyer4360
    @felixmeyer4360 4 ปีที่แล้ว +4

    Such an amazing video! just spent 3 hrs banging my head against the wall with apache and I love this process!

  • @gargantuan4696
    @gargantuan4696 4 ปีที่แล้ว +2

    You could link a local volume instead so you don’t have to rebuild the container on every change, simply refresh

  • @drakhlur1
    @drakhlur1 4 ปีที่แล้ว +1

    Hey man, thanks for the great tutorial. It helped at lot! For the next video, could you please explain how to add a Redis container to act as a queue for the requests coming into the web app?

  • @xfabiosoft
    @xfabiosoft 5 ปีที่แล้ว +7

    I good improvement is to use docker volumes during development. So you don't have to build new containers every time

  • @juansidberry4422
    @juansidberry4422 3 ปีที่แล้ว +2

    This is GREAT. You have explained what a developer would actually do step by step to get an app to containerization and production. I can now containerize my applications logically and simply in a very structured manner. THANK YOU! I will now watch the rest of your videos. Really appreciate your work here. Please keep sharing.

  • @danieldecasse2924
    @danieldecasse2924 2 ปีที่แล้ว +1

    cant seem to get UsWGI installed. Im on windows 10. feel like I am something simple. any help is appreciated

  • @hawwestin
    @hawwestin 4 ปีที่แล้ว +5

    1 min in ...music is to loud in compare to your voice level.

  • @prabhashswain1878
    @prabhashswain1878 3 ปีที่แล้ว +1

    Please sir make a video with django Docker Nginx gunicorn

    • @ishanmodi3583
      @ishanmodi3583 3 ปีที่แล้ว

      this is not an appropriate video for learning
      towardsdatascience.com/how-to-deploy-ml-models-using-flask-gunicorn-nginx-docker-9b32055b3d0
      try this link

  • @kevinmbtbass
    @kevinmbtbass 5 ปีที่แล้ว +3

    Extremely helpful! Would you be interested in making a video on implementing TLS with this kind of architecture?

  • @yomajo
    @yomajo 2 ปีที่แล้ว

    Yeah, question. Say flask app is hosted in cloud somewhere. Say it's containerized with docker. How do you update app when it's live in production?

  • @PREC0GNITAVE
    @PREC0GNITAVE 4 ปีที่แล้ว +1

    thanks for this Tutorial it has helped me a lot. What would I need to change if I wanted to run the Nginx container and flask container on separate machines? I assume modifying the nginx.conf file to point at the ip of the flask machine, would uwsgi_pass still be uswgi_pass flask:8080 though?

  • @dannisisgt
    @dannisisgt 3 ปีที่แล้ว +1

    Thanks Julian, I watch once and then another time your videos, it help me so much with because they are very informative and fundamentals, I tried to run this example and I found an issue with uwsgi installation in python3.8, after read many blogs finally found a workaround, we can install the module pyuwsgi, please continue with your videos

  • @ehgarc
    @ehgarc 3 ปีที่แล้ว

    Wasted four hours of my life on this:
    and worst part is he does not have a github (what kind of developer does not have a github?)
    Followed video and tutorial to a T
    flask | Traceback (most recent call last):
    flask | File "run.py", line 1, in
    flask | from app import app
    flask | ImportError: cannot import name 'app' from 'app' (unknown location)

  • @christiantshizubu8608
    @christiantshizubu8608 3 ปีที่แล้ว

    Hey! Julian what's up. I am havin the following error after docker-compose up ==> "uwsgi": executable file not found in $PATH: unknown

  • @vincenandorfi8898
    @vincenandorfi8898 2 ปีที่แล้ว

    For me that was an issue: --- no python application found, check your startup logs for errors ---
    Solution: instead of -> "wsgi-file = main.py" used this -> "module = main:app" in the "ini" file.

  • @yassinezara9641
    @yassinezara9641 ปีที่แล้ว

    Thanks for this Tuto, it's awesome. the Tutorial link is not working :(

  • @moha6243
    @moha6243 ปีที่แล้ว

    Hello Julian, I worked with your tutorial and I have one question how i have to configure the VS-Code Debugger to debug this Setting?

  • @DonLarryTT
    @DonLarryTT 4 ปีที่แล้ว +1

    what happened to the channel? are you alive? :(
    I love your videos!

  • @Dennis-us6zd
    @Dennis-us6zd 2 ปีที่แล้ว

    Hi Julian, thanks a lot for sharing this insightful vid. Could you also please show how this could be done with an additional database service and a front end service? Say a Postgresdb folder and a react folder with typescript code in it? Thanks !

  • @ramchunduri1822
    @ramchunduri1822 4 ปีที่แล้ว

    Thanks! it's helpful.

  • @Gn0mH4nT3r
    @Gn0mH4nT3r ปีที่แล้ว

    thank you for your tutorial, it was kind of useful. My question is, how can I put these into one docker image?

    • @assaultx5677
      @assaultx5677 ปีที่แล้ว +1

      I don't know the answer mate but I just want to tell you that he had stop uploading new videos and he's not going to answer your question. You can see his last upload was 3yrs back.
      May be he just quitted the TH-cam because of poor response or maybe something else.
      But his videos are really helpful.

    • @Gn0mH4nT3r
      @Gn0mH4nT3r ปีที่แล้ว +1

      @@assaultx5677 well thank you, I solved the issue (with lot of effort), however the good practice the way that is presented in the video (using separate images and containers)

  • @1endell
    @1endell ปีที่แล้ว

    Thank you, man! One question: the uwsgi_params file must be in the app folder?

  • @davidpaez_co
    @davidpaez_co 4 ปีที่แล้ว +5

    17:50 "Building an image" was actually correct. You first build an image and then create and run a container based on that image.
    Great tutorial. Thank you Julian

  • @zobkiw
    @zobkiw 3 ปีที่แล้ว

    Nice tutorial but the music is not necessary and really takes away from the entire video since you constantly hear a little "plink" all the way through.

  • @houmie
    @houmie 4 ปีที่แล้ว +2

    Amazing tutorial. To the point, without making it sound too complicated.

  • @davidmakowka922
    @davidmakowka922 4 ปีที่แล้ว +1

    This is what you do to get new subscribers. Wish everyone would keep this level of quality of videos. Really like your content

  • @scorprog
    @scorprog 2 ปีที่แล้ว

    Hi, nice tutorials. Can you a Flask-SQLAlchemy tutorial.

  • @king-cog
    @king-cog 2 ปีที่แล้ว

    Nice Video!!! I wish my ears could tune off the beeping sound.

  • @sumitasagaonkar2865
    @sumitasagaonkar2865 2 ปีที่แล้ว

    --- no python application found, check your startup logs for errors please help

  • @HugoStone523
    @HugoStone523 ปีที่แล้ว

    Do anyone have the problem that uwsgi error with python3.11?

  • @leonardomarques9343
    @leonardomarques9343 4 ปีที่แล้ว +2

    i using windows to do and i cant install uwsgi, any tips?

    • @estebanmejia9989
      @estebanmejia9989 4 ปีที่แล้ว

      i had the same problem, i solved that problem without copy the env folder. Just install everything globally on the container, linux can install uwsgi, but windows

  • @sainbayarbattur4348
    @sainbayarbattur4348 3 ปีที่แล้ว +1

    Brilliant series of videos. I certainly wish I’d found them earlier! Thanks very much.

  • @sssrnty6280
    @sssrnty6280 3 ปีที่แล้ว

    man thanks for this

  • @mahmoudalshalaldeh9012
    @mahmoudalshalaldeh9012 2 ปีที่แล้ว +2

    Rest in Peace Julian

    • @assaultx5677
      @assaultx5677 ปีที่แล้ว

      Is that true.

    • @mahmoudalshalaldeh9012
      @mahmoudalshalaldeh9012 ปีที่แล้ว

      @@assaultx5677 I believe so. Forgot how I found out.

    • @ИванЧай-ф6м
      @ИванЧай-ф6м 10 หลายเดือนก่อน

      It is awful. I really thought that he is died... I checked him LinkedIn, it looks like that he is alive. This is cruel joke...

  • @bluebearry2203
    @bluebearry2203 3 ปีที่แล้ว

    I cant for the life of me instal uwsgi on windows D: pip just wont work

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

    How would deploy this docker container

  • @timsavory9718
    @timsavory9718 3 ปีที่แล้ว

    Hi Julian, Great Tutorial. Do i really need to add the nginx part if deploying to a Synology NAS which already has nginx web server and reverse proxy set up on? Thanks Tim

  • @bostevens236
    @bostevens236 3 ปีที่แล้ว +1

    I really like how you kept it basic, and EXPLAINED the basics. Well done!

  • @ramaswamym7309
    @ramaswamym7309 5 ปีที่แล้ว +1

    Thank you so much Julian. It's extremely helpful for me to understand the overall concept. Keep rocking bro :-)

  • @joaovictorpereirarocha33
    @joaovictorpereirarocha33 4 ปีที่แล้ว +1

    Great Tutorial. I learned a lot of things. Thanks!

  • @cantis
    @cantis 3 ปีที่แล้ว

    sigh, good tutorial, very good presentation and tone but, like a lot of enthusiasts another assumption that Linux is the default coding environment, it isn't. Nowhere did you mention that UWSGI is not installable on windows. Remember that LOTS of government and business environments DO NOT use Linux on the desktop, they might use Linux servers but not desktops.

  • @panzorax.
    @panzorax. 3 ปีที่แล้ว

    i can't install uwsgi how i can install ????

  • @scotter
    @scotter 3 ปีที่แล้ว

    Wow. So thorough and easy to follow. Thank you!!!
    Questions:
    (1) How do we differentiate apps? Am I correct in assuming when each app has its own container, all except ports (and of course our python program itself) can be the same file names, as long as our primary change is to name the root folder "FLASKAPP" something different for each container?
    (2) What if we have different domain names pointing to each different app, how do we direct those domain names to the correct app? Does all this work on a Windows server? I assume so, because I have nginx running on my Windows 2019 server.
    (3) If I already have Postgres running on the same server and my ONE python app running fine using that Postgres server, do you recommend tying Postgres into the docker containers somehow? I assume my Postgres server doesn't have to be containerized?
    THANK YOU!

  • @experimental_av
    @experimental_av 4 ปีที่แล้ว +1

    hey thanks for the tutorial. i was running into issues with my project and looked at a couple of step by step instructions and yours really stands out as the best.

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

    Keep up the amazing work

  • @ir0nwarez0925
    @ir0nwarez0925 ปีที่แล้ว

    Hi Julian, your links are all dead :(

  • @karimmoradi2003
    @karimmoradi2003 2 ปีที่แล้ว

    I am wondering about the volumes which are presents in both services; flask and nginx. In 16:51 we see both services have a "volumes" property. Later when you removed the comments at 16:55 the 'volumes' properties were also disappeared.

  • @sagarchoudhary8080
    @sagarchoudhary8080 2 ปีที่แล้ว

    really very helpful thanx a lot :)

  • @sergeyshevtsov5125
    @sergeyshevtsov5125 5 ปีที่แล้ว +2

    Julian come back! You had very good content!

  • @aguspray
    @aguspray 2 ปีที่แล้ว

    i have a question, why i am always getting error when install uwsgi with pip in my virtual environment? is it because I use windows?

    • @Millez
      @Millez 2 ปีที่แล้ว

      If it's an error when you run "docker build", try adding "RUN apk add python3-dev build-base linux-headers pcre-dev" to the Dockerfile before "RUN pip install uwsgi"

  • @exoticgolfholidays
    @exoticgolfholidays 3 ปีที่แล้ว

    So what happened to Databases?

  • @ronaldronald8819
    @ronaldronald8819 4 ปีที่แล้ว

    I totally enjoyed your tutorial.
    Question: I run docker on a Raspberry pi and like to test remote using the pi's ip instead of the localhost can that be done?

  • @opeyemiatoyebi
    @opeyemiatoyebi 3 ปีที่แล้ว

    The video is cool. I tried to connect my docker to my local mysql server, but am getting connection refuse. Any suggestion, please

  • @BM-uf4pp
    @BM-uf4pp 3 ปีที่แล้ว

    how about static files?

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

    Where did Julian go?

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

    Thank you Julian!

  • @xanderx8289
    @xanderx8289 5 ปีที่แล้ว +1

    How are you using that Hyper? Is it on top of Powershell but with Unix commands? I don't quite get it.

  • @harutmikayelyan1701
    @harutmikayelyan1701 4 ปีที่แล้ว

    Thanks a lot

  • @chandankumaryadav2505
    @chandankumaryadav2505 4 ปีที่แล้ว

    While doing docker-compose up, I landed into an issue:- "invalid chmod value: true" for `chmod-socket=true` in app.ini file
    Probable fix:
    chmod-socket = 666 (664 can also work for www-data)
    uid= www-data
    gid= www-data,
    updating the above value in app.ini file fixed my issue

  • @dayuraharja6941
    @dayuraharja6941 3 ปีที่แล้ว

    how to add phpmyadmin

  • @kvicar7419
    @kvicar7419 4 ปีที่แล้ว +4

    How did you installed the flask uWSGI? My try ended with Atribute Error: module 'os' has no attribute 'uname'. And we're using exactly the same OS.

    • @juancarlosprieto2872
      @juancarlosprieto2872 4 ปีที่แล้ว +3

      Are you using windows? Because you cannot install uWSGI on it (except with cygwin). What i did was skipping the pip install part of the video and only installed flask. Then in my flask docker file i changed the install dependencies to: RUN pip install uwsgi -r requirements.txt and It's working fine for me.
      Also, your localhost will not be where you just usually find it. You have to go to 192.168.99.100
      as it is stated here: stackoverflow.com/questions/42866013/docker-toolbox-localhost-not-working

    • @OmShridhar94
      @OmShridhar94 4 ปีที่แล้ว +1

      @@juancarlosprieto2872 dude i love u my man!

  • @thevijayraj34
    @thevijayraj34 4 ปีที่แล้ว

    Actually we can do updating the codes without rebuilding it. Just need to mount the dev folder with port binding in compose XML.

  • @nubiedriver
    @nubiedriver 2 ปีที่แล้ว

    great intro. thks

  • @knightxii
    @knightxii 4 ปีที่แล้ว

    Great tutorial. Please remove the annoying background music. It really makes it hard to hear especially at higher playback speed.

  • @nawid1687
    @nawid1687 4 ปีที่แล้ว

    Please more vids

  • @PavelZagalsky
    @PavelZagalsky 5 ปีที่แล้ว +3

    Thanks for the tutorial Julian, this will help a big problem I work on. Shame about the music though, very distracting. Thanks!!

  • @anderssegerlund818
    @anderssegerlund818 2 ปีที่แล้ว

    Super helpful guide. But is there a way to implement hot-reloading to avoid restarting the container when making an update in the flask app

  • @alainandres1467
    @alainandres1467 4 ปีที่แล้ว +1

    Hi , can you help me please? i have this error when i execute docker-compose up : realpath() of app.ini failed: No such file or directory [core/utils.c line 3654]
    thanks !

    • @NikhilPareek92
      @NikhilPareek92 3 ปีที่แล้ว

      Two changes you could do:

    • @NikhilPareek92
      @NikhilPareek92 3 ปีที่แล้ว

      1) Update the views.py with the code: from app import app
      import os
      @app.route("/")
      def index():
      # Use os.getenv("key") to get environment variables
      app_name = os.getenv("APP_NAME")
      if app_name:
      return f"Hello from {app_name} running in a Docker container behind Nginx!"
      return "Hello from Flask"

    • @NikhilPareek92
      @NikhilPareek92 3 ปีที่แล้ว

      2) Stop all the previous containers and restart - docker container prune

  • @asiddiqi123
    @asiddiqi123 4 ปีที่แล้ว

    So every time I make changes I build it? Why don't you mount volume?

  • @victorherrera4527
    @victorherrera4527 3 ปีที่แล้ว

    Thank you for the tutorial! Is it possible to run both Nginx and uWSGI in the same container?

  • @ram1879
    @ram1879 4 ปีที่แล้ว

    Excellent video!! I'm trying to add pulling code from GitHub in the compose file. Thank you so much for getting me started. I was able to build my fully working flask app using mysql as the back end in less than 2 minutes. So that is db, app and nginx in less than 2 minutes! Thank you!

  • @shinichi9do
    @shinichi9do ปีที่แล้ว

    thanks a lot

  • @iwoz
    @iwoz 4 ปีที่แล้ว

    great video.can you make a video for debugging flask inside the container with VSCode

  • @golfstallion1354
    @golfstallion1354 2 ปีที่แล้ว

    This was a very useful video. It got me up and running in docker and docker-compose. Thank you for sharing Julian.

  • @Virdevir
    @Virdevir 3 ปีที่แล้ว

    Outstanding video ! Thank you! Looking forward for new videos.

  • @imaginarylaurel
    @imaginarylaurel 2 ปีที่แล้ว

    Good job

  • @joey0827GandD
    @joey0827GandD 4 ปีที่แล้ว

    Oh damn the sound his keyboard makes is really satisfying... can anybody figure out what or what kind of keyboard he uses (eg. mechanical, non-mechanical)?

  • @marquezdrums
    @marquezdrums 4 ปีที่แล้ว

    I cannot get the nginx server to serve the pages. Anyone else get stuck on this? I just get the default nginx page.

  • @danielstadler3390
    @danielstadler3390 4 ปีที่แล้ว

    I subscribed because you are criminally under-subbed. Excellent tutorial.

  • @saurabhramya144
    @saurabhramya144 4 ปีที่แล้ว

    uWSGI does get installed on the windows machine. How did you solve that?

  • @dannys1613
    @dannys1613 5 ปีที่แล้ว

    Can you show us totorial how to setup WSL and VS Code because i cant set the PATHs etc I can only setup the WSL terminal but how i can use my WSL python in vscode or i need to install it on windows too

  • @rasanjayasubasinghe2454
    @rasanjayasubasinghe2454 2 ปีที่แล้ว

    @Julian, Very awesome tutorials and hope you will start continue with the new content.

  • @ahmedabdelfattah443
    @ahmedabdelfattah443 3 ปีที่แล้ว

    Great video, please tune down the music or remove it entirely from the next one.

  • @jussivisapaa1826
    @jussivisapaa1826 2 ปีที่แล้ว

    Thanks for this great tutorial! - Straight forward in a good speed. Solved some of my issues with docker/flask

  • @mehmetaliozer2403
    @mehmetaliozer2403 4 ปีที่แล้ว

    awesome tutor, could you deploy a flask app on digitalocean droplet with docker and using a custom domain