.NET 7 💥 -- How to containerise Web API with Docker & use PostgreSQL
ฝัง
- เผยแพร่เมื่อ 6 ก.ย. 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
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
Would be handy if you make a video about the migrations being run automatically
52:03 thanks for video and please do video with first option (migration to run automatically)
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.
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.
Amazing video! thank you so much for this. An automatic migrations tutorial would also be great, keep it up!
Thank you Lawand. Your lecture is clean, clear and concise
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
Thank you so much Mohamad for such great content, have put notification on!!! Much love from South Africa!
Great video. Do you have a github repo for this tutorial?
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
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
Thank you so much Lawand. It's bcoz of you I was able to learn about docker and execute it. Bigg help
Super nice!!!!!!! Thanks How we can run migrations automatically un docker-compose.yml file?
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.
your explanations are really understandable and with a good pace
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 ^^
This is so helpful with step by step explanation. Thank you so much.
you nailed it bro
ربنا يجازيك كل الخير يارب
أمين مشكور والله
Best!
Thanks for the video. Is necessary we create Dbcontext in our app if we want connect with postgresql database?
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.
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?
Did you push this to some repo? Would be nice to browse the code! Thanks
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.
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.
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.
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."
Thank you for such informative videos!
Absolutely fantastic video, very well done!
Beautiful walkthrough!
Thank you! 👍
Thanks for the detailed explanation!
Great video as usual!
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?
Do i have to create a docker container prior to adding this
Thanks, helped me with the migration
thanks for leaving the code in... wherever it is.
Great tutorial thanks a lot Mohammed
Amazing! Thank you! ❤🔥
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
brabooo
Hi mo, can you make tutorial for .net microservices.
I agree
Thank you very much for intersting and useful information!
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
Thank you very much!
Thank you for the great video.
Thank you so Much .
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!
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
Any one else getting this error at the end when sending a get request "The ConnectionString property has not been intilaized "?
vaar con = Environment.GetEnvironmentVariable(
awesome
You're a god
thank you
Thanks
Saved my ass, thank you!!!
Thank you for your support
24:49
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
v3 :)
dude, your face is covering most of the things you do
Thank you very much!!!