.NET 7 💥 -- How to containerise Web API with Docker & use PostgreSQL

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • In this video we will be going to be containerising a .NET 7 API with PostgreSQL and Docker Compose
    Support me on Patreon to access the source code:
    / mohamadlawand
    Let us connect:
    🌍 My website - mohamadlawand.com
    📸 Instagram - / mohamadlawand087
    🐦 Twitter - / moe23
    ♯ Github - github.com/moh...
    🎫 LinkedIn - / mlawand
    💥 LinkTree - linktr.ee/moha...
    Gear I use (affiliate link): amzn.to/3EbT8Jw
    Support my work:
    / mohamadlawand
    www.buymeacoff...
    Hire Me:
    transactions.s...
    WHO AM I:
    I'm Mohamad, a Enterprise Architect working in Manchester, UK. I make videos about web, cloud, desktop and mobile development.
    GET IN TOUCH:
    If you’d like to talk, I’d love to hear from you. Tweeting @moe23 directly will be the quickest way to get a response, but if your question is very long, feel free to email me at hello@mohamadlawand.com.
    #dotnet #postgresql #docker

Комментарии • 67

  • @ivandrofly
    @ivandrofly Год назад +9

    11:48 Connection string
    36:54: Docker compose creation
    41:00 Setting the connection string on docker-compose
    41:10 menitioned that he connections tringwill be auto-injected into app
    50:17 : API testing tool Insomnia (like Postman)
    Remarks: Why the environment variable name in docker compose is not the same as in appsettings

  • @Ertan_Taner
    @Ertan_Taner Год назад

    Thank you Mohamad, ı made a compose file for my backend api + db + redis service and it's working without a problem. I am learning so many stuff from you. I used Dockerfile and wants to learn a bit about compose. Thanks so much again ^^

  • @jmejias00
    @jmejias00 Год назад +3

    Great video. Do you have a github repo for this tutorial?

  • @wolfVFXmc
    @wolfVFXmc Год назад +6

    Would be handy if you make a video about the migrations being run automatically

  • @agustinbcu
    @agustinbcu Год назад +7

    Awesome video, I will love to see a Dev environment vs stage, and production environment; the database upgrades thru the EF core migration script, and the implications of always getting the latest version of the database. Overall well presented. Mine only advises having all the commands on an editor and copying and pasting.

  • @jesusmendoza6536
    @jesusmendoza6536 Год назад +2

    Super nice!!!!!!! Thanks How we can run migrations automatically un docker-compose.yml file?

  • @mirkozaper
    @mirkozaper 8 месяцев назад +2

    52:03 thanks for video and please do video with first option (migration to run automatically)

    • @afonsocarvalho3124
      @afonsocarvalho3124 5 месяцев назад +1

      I need some guidance on running migrations automatically too. If you have a real project with too many tables, doing manually is very time consuming, and the migrations are already there ready to be applied. Thank you for this video.

  • @TALHA.FF.8
    @TALHA.FF.8 Год назад +9

    One good practice (always) should be, even in demos, always use real world production code, so that even a beginner can learn the real world code, do a purpose build demo, not just for "simple demo".
    Don't do what 99% of other online tutors are doing (just demo purpose tutorials). There are tutorials for beginners, but not for experienced ones. Don't they need some advance level expertise?
    Also, can you make a demo on calling 500-1000 APIs at the same time and just wait for the ok 200 response.? What would be the best practical approach? I am asking you as you are the enterprise architectect.

    • @xender2112
      @xender2112 Год назад +2

      His demos are not real world projects but they are more complex than an usual demo. At least his demo in this video has database. It's enough to understand how to create and then to connect services by virtual network interface.

    • @bhound12
      @bhound12 Год назад

      Not everyone would agree with you. I got exactly what I wanted from this video, as did many other viewers. The video is concise and delivers on exactly what the title says.

  • @HilalYazbeck
    @HilalYazbeck Год назад +2

    great stuff, can you create a video about dotnet core clear architecture (onion) with a simple repository pattern and unitofwork? i would love to see your approach

  • @andresviera-ecuador4984
    @andresviera-ecuador4984 8 месяцев назад

    Good afternoon, so I have a problem starting my applicattion is this error "warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect."

  • @adam-xt8te
    @adam-xt8te 5 месяцев назад

    35:25 I stuck at this moment and I can't force API to throw those exceptions. In browser I got 404. I'll try later. Effects in the end are worth trying. Thank you for your effort

  • @barchilsaid3001
    @barchilsaid3001 10 месяцев назад

    Thank you so Much .

  • @obasoroolakunle8421
    @obasoroolakunle8421 3 месяца назад

    Thanks for the video. Is necessary we create Dbcontext in our app if we want connect with postgresql database?

  • @100kshooter5
    @100kshooter5 Год назад +2

    Thank you so much Mohamad for such great content, have put notification on!!! Much love from South Africa!

  • @stesvis
    @stesvis 6 месяцев назад

    Did you push this to some repo? Would be nice to browse the code! Thanks

  • @oleksiihytsiv
    @oleksiihytsiv Год назад +1

    How can he actually create migrations with an empty connectionString?
    When I tried that, I got an error: The string argument 'connectionString' cannot be empty.

  • @williampuma8241
    @williampuma8241 11 месяцев назад

    awesome

  • @prasangupta2978
    @prasangupta2978 7 месяцев назад

    Do i have to create a docker container prior to adding this

  • @diegomelgar2696
    @diegomelgar2696 10 месяцев назад

    Hi Mohamad,
    Is it possible that you create a video for containerise the same application but running on HTTPS as development environment. I am facing some issues that I haven't found a proper solution. The API doesn't run because of missing certificates.
    After properly setup the certificates using dotnet dev-certs and dotnet user-secrets and mapping the volumes inside docker-compose I still have the problem.
    Thanks!

  • @shivpratapshukl1445
    @shivpratapshukl1445 Год назад +2

    Hi mo, can you make tutorial for .net microservices.

  • @proffnick2405
    @proffnick2405 8 месяцев назад +1

    Thank you Lawand. Your lecture is clean, clear and concise

  • @yosterdaniel1213
    @yosterdaniel1213 Год назад +1

    Any one else getting this error at the end when sending a get request "The ConnectionString property has not been intilaized "?

    • @ivandrofly
      @ivandrofly Год назад

      vaar con = Environment.GetEnvironmentVariable(

  • @SingleServingMimic
    @SingleServingMimic Месяц назад

    Amazing video! thank you so much for this. An automatic migrations tutorial would also be great, keep it up!

  • @rogerstich7603
    @rogerstich7603 11 месяцев назад

    very nice Tutorial, thank you for that.
    One question: How to do all the Connection String Magic properly, so i dont have them inside my Dockerfile and finally in my Git Repo?

  • @stoic2454
    @stoic2454 4 месяца назад

    Thank you soooooo much, I was stuck on this step, i never realized i'm using production evn and kept on thinking why i'm not getting swagger, lol

  • @rustam_gasymov
    @rustam_gasymov Год назад

    It's powerful!! Can you say please how can i debug(in vscode) my application when I run using docker compose?? Or somebody knows? Thanks a lot

  • @chinmaykaviskar5757
    @chinmaykaviskar5757 7 месяцев назад

    Thank you so much Lawand. It's bcoz of you I was able to learn about docker and execute it. Bigg help

  • @creamOnDs
    @creamOnDs Год назад

    i think it would be better if you explain the code while showing the code, I keep moving back to where you show the code after listening to your explanation

  • @leleca987
    @leleca987 8 месяцев назад

    brabooo

  • @keithcarrillo8238
    @keithcarrillo8238 4 месяца назад

    24:49

  • @xender2112
    @xender2112 Год назад

    Thank you so much. It's so useful. Especially the part where database migrations inject in the db container.
    If not you, instead of 1 day I'd spend 1 week or more to containerize my project.

  • @raptoverdad
    @raptoverdad Год назад

    thanks for leaving the code in... wherever it is.

  • @bryanfatjo3188
    @bryanfatjo3188 Год назад

    hey Mohamad good job.😀
    I found your explanation really good some time I needed some subtitles, but even the automated subtitles were saying that is music. Doesn't matter still get >95%.
    Saludos Cordiales

  • @mosheritterman3472
    @mosheritterman3472 Год назад

    Great tutorial!
    Do you have another video where you demonstrate how to deploy this to production (i.e. Azure or AWS)?
    Also, how would you add your docker-compose file in source control (i.e. GitHub) so that the connection string is secure?

  • @АртемБарабанов-х2б

    Thank you very much for intersting and useful information!

  • @Shanks-at-Work
    @Shanks-at-Work 8 месяцев назад

    This is so helpful with step by step explanation. Thank you so much.

  • @OgnjenBokic-c7e
    @OgnjenBokic-c7e Год назад

    Awesome video as always. Should SDK commands be executed inside a Docker container rather than within a directory on the local machine? When I try, I get a message that the SDK is not installed within the container. Thanks

  • @patricksantos9309
    @patricksantos9309 9 месяцев назад

    Thanks, helped me with the migration

  • @99aabbccddeeff
    @99aabbccddeeff 11 месяцев назад

    Thank you for such informative videos!

  • @elliotaldersone4969
    @elliotaldersone4969 Год назад

    Great tutorial thanks a lot Mohammed

  • @lifeisbeautifu1
    @lifeisbeautifu1 11 месяцев назад

    Amazing! Thank you! ❤🔥

  • @alexanderbondarchuk
    @alexanderbondarchuk Год назад

    Thank you very much!

  • @alihamzaansari2012
    @alihamzaansari2012 11 месяцев назад

    your explanations are really understandable and with a good pace

  • @syneticsolutions344
    @syneticsolutions344 Год назад

    Absolutely fantastic video, very well done!

  • @Tymonello
    @Tymonello Год назад +1

    v3 :)

  • @sumeshsidharth3255
    @sumeshsidharth3255 Год назад

    Thank you for the great video.

  • @SonyaSakayev
    @SonyaSakayev Год назад

    Thanks for the detailed explanation!

  • @guillesanchez493
    @guillesanchez493 Год назад

    Thank you very much!!!

  • @MegaMaistro123
    @MegaMaistro123 Год назад

    you nailed it bro
    ربنا يجازيك كل الخير يارب

  • @shade9200
    @shade9200 Год назад

    You're a god

  • @ЕвгенийЗахаров-т5и
    @ЕвгенийЗахаров-т5и 6 месяцев назад

    Best!

  • @simontouma7924
    @simontouma7924 Год назад

    Great video as usual!

  • @csabagyarmathy6386
    @csabagyarmathy6386 10 месяцев назад

    Saved my ass, thank you!!!

  • @Pan_Policjant
    @Pan_Policjant Год назад +1

    dude, your face is covering most of the things you do

  • @RoyZASTEROiD
    @RoyZASTEROiD Год назад

    thank you

  • @fkbey5756
    @fkbey5756 Год назад

    Thanks

  • @manssternerbostrom3148
    @manssternerbostrom3148 11 месяцев назад

    Beautiful walkthrough!