Docker Compose with .NET 8, PostgreSQL, and Redis (step by step)

  Рет қаралды 67,212

Milan Jovanović

Milan Jovanović

Күн бұрын

Пікірлер: 213
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Get the source code for this video for FREE → the-dotnet-weekly.ck.page/docker-compose Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@markovertus3909
@markovertus3909 Жыл бұрын
In every project, I love it. However, it's still an issue for real development. I would prefer to have a real time build and compile on every file save + debug if the app is running inside docker-compose. When I saw the title of your video, was low key hoping to see that, as it's still eludes me on .NET.
@Its_Kaleb_
@Its_Kaleb_ Жыл бұрын
Been messing around with docker a bit more recently, particularly for using dev containers in VS Code. Made for some interesting, config-as-code dev environments using compose to wire up dependencies too. Have you done much with dev containers?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
@@markovertus3909 I recently learned about 'Docker Compose Watch' - worth looking into
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
@@Its_Kaleb_ No, but I've played around with Testconatiners for my integration and E2E tests
@markovertus3909
@markovertus3909 Жыл бұрын
@@MilanJovanovicTech yea, Ive played with it as well. I dont like that you need to mount your dlls for it to have any effect. But other then that, I agree with you, the support for docker and compose especially in Visual Studio is pretty insane.
@igorbarros9620
@igorbarros9620 Жыл бұрын
I'm going to make myself a cup of coffee and get ready for some knowledge from the Wizard Milan himself. \m/
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Hope I delivered, then 😁
@igorbarros9620
@igorbarros9620 Жыл бұрын
@@MilanJovanovicTech You sure did! Hey, man. Any chance I can a discount on your course? I live in Brazil, so for me to pay, it's like 5x times the current price (1 dollar is like 4.98 reais). I have been watching your videos since last december, and you have been helping a lot on my work! And thank you for that :))
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
@@igorbarros9620 Check the course page, there should be a purple banner on top with a discont code (for Brazil)
@aweklin
@aweklin Жыл бұрын
Thanks Milan for this great and straight-to-the-point video. Stay awesome 🎉
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Always!
@UberEverywhereSKRT
@UberEverywhereSKRT Жыл бұрын
Milan your videos are the best. I been following you for a minute now and ur amazing. Would be nice if u could do a video on how to setup a full .net development flow including dev, stage, prod env with docker , how to handle env variables during local vs prod (in cicd for example). I get confused on where the env variables (and secret) should be stored in local dev vs prod (where and when they are fetched from, etc). Ty in advance!
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Great suggestion!
@rafaspimenta
@rafaspimenta 11 ай бұрын
​@@MilanJovanovicTech Go for it please :P
@LucasLima-il4ky
@LucasLima-il4ky 6 ай бұрын
I do not have words to thank you Milan , sure i'm going to buy your courses!! THANK YOU FOR ALL KNOWLEDGE!!
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
My pleasure!
@itssalmanvlogs_
@itssalmanvlogs_ Жыл бұрын
I always learn something new watching your videos, Thank you.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Happy to help! :)
@Fikusiklol
@Fikusiklol Жыл бұрын
Cool stuff, Milan Just a couple of things: 1) you want to depend_on a database in compose file to be created first 2) you can specify environments in compose for appSettings file using ConnectionString__Database | Redis, cause those might be different for production/dev
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
2) Which is why I'm using appsettings.Development.json, which shouldn't be used in production anyhow
@Mark-jk1jv
@Mark-jk1jv 3 ай бұрын
Another excellent video Milan. These short video tutorials are excellent learning resources. Thanks.
@MilanJovanovicTech
@MilanJovanovicTech 3 ай бұрын
Glad you like them!
@bojned
@bojned Жыл бұрын
Nice and practical... I don't spend as much time coding these days (at least as not as much I would like), and videos like these keeps my knowledge fresh and up to date.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Glad it was helpful!
@willgordon5737
@willgordon5737 4 ай бұрын
Bro you are so smart you must be working in a FAANG company thank you and congratulations for 100 k subscribers, you deserve a million!
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
Working for myself, even better 🤷‍♂️
@andresbeltran5779
@andresbeltran5779 7 ай бұрын
Thank you, I was suffering for several days to achieve this and finally I did it
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Awesome, good job 🏆
@DaminGamerMC
@DaminGamerMC Жыл бұрын
Great video, just what i needed for my job
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Perfect!
@sunzhang-d9v
@sunzhang-d9v Жыл бұрын
Can you explain more? Many of you don't understand. From the comments, it can be concluded that Redis is just a client? How to publish it online for use?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
You run Redis like any other service
@juanlopeztello7315
@juanlopeztello7315 Жыл бұрын
Excelent. It would be nice a video about setting up a development environment using devcontainers in vscode
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Great suggestion!
@kj2w
@kj2w Жыл бұрын
This video is awesome. I shows a great use case for using Docker with an already working system. Correct me if I'm wrong but didn't you also do a video where integration tests can leverage a docker container?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Yes: kzbin.info/www/bejne/qpuYi3aqq8yLgbs And publishing a functional testing video soon
@distractednine_di
@distractednine_di 5 ай бұрын
Thank you very much! This video saves lives!
@MilanJovanovicTech
@MilanJovanovicTech 5 ай бұрын
Glad it helped!
@giorgospanagopoulos3993
@giorgospanagopoulos3993 Жыл бұрын
Excellent video. If you also showed how to connect to the data source via postgres & redis client UIs it would have been a perfect one!
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
May make a YT short for that
@stochasticity86
@stochasticity86 Жыл бұрын
Amazing and to the point. Love it!
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Glad you liked it!
@shuvo9131
@shuvo9131 Жыл бұрын
Thanks for awesome explanation. This is to the point
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
You're very welcome :)
@branislavstojkovic2040
@branislavstojkovic2040 2 ай бұрын
Great tutorial! Thank you very much Milan :D
@MilanJovanovicTech
@MilanJovanovicTech 2 ай бұрын
My pleasure!
@ForrestBrown
@ForrestBrown 4 ай бұрын
Running migrations this way in development is definitely easy, but how would you recommend running them for production? Thanks for all of the great videos!
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
www.milanjovanovic.tech/blog/efcore-migrations-a-detailed-guide
@harunaabaldeh2006
@harunaabaldeh2006 2 ай бұрын
I was going to ask the same question but luckily found this one already?
@feinirl
@feinirl Жыл бұрын
great video my guy :3 thanks for pca v2 btw you're insane
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
You're welcome. I'd appreciate any feedback on V2 😁
@ertackosucu
@ertackosucu Жыл бұрын
Excellent as usual. Thank you.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Glad you enjoyed it
@selmangulmez6476
@selmangulmez6476 Жыл бұрын
Hey Milan, Cache GetAsync doesnt have overload callback function which extension package gives that chance for us? Thanks for informations.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
It's this: github.com/mgravell/DistributedCacheDemo/blob/main/DistributedCacheExtensions.cs
@UnseenScofield
@UnseenScofield Жыл бұрын
Thanks @@MilanJovanovicTech
@montanomariano
@montanomariano Жыл бұрын
Great video! What if you were using database-first code-first approach? How would you make sure you get a copy of your existing database?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
This example is code-first. The migrations are applied when the app starts. But you can connect to the DB as any other database, and apply your changes.
@juancarlosalemanmayorga3093
@juancarlosalemanmayorga3093 4 ай бұрын
Thanks Milan!! Interesant, using the cache
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
Glad you liked it!
@maevshadowsong
@maevshadowsong Ай бұрын
what a nice speedrun lesson
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
Hey, thanks!
@mohamedalaa8212
@mohamedalaa8212 Жыл бұрын
Another fantastic video, as always! Keep up the great work! 💥 I'm also curious about the process by which Docker Compose build the productapi image and assigning it the dev tag.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
That's a subject for a different video 😁
@kodindoyannick5328
@kodindoyannick5328 3 ай бұрын
Thanks for all of the great videos!
@MilanJovanovicTech
@MilanJovanovicTech 3 ай бұрын
Just happy to help :)
@shanabunny
@shanabunny 4 ай бұрын
You explain things so well! Thank you
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
Glad it was helpful!
@Corvin_
@Corvin_ Жыл бұрын
Really cool video, could you please clarify when or why you would use this? I can never really find scenarios on my own where docker makes my life easier. Does it make local development easier compared to setting up a localdb? Can you for example connect a db from the cloud for the production environment?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Local development would be the main use case. Everyone in your team has the same environment.
@Corvin_
@Corvin_ Жыл бұрын
@@MilanJovanovicTech Alright cool. I guess it is a tiny bit simpler than applying migrations for localdb on everyone's pc. But not by a ton.
@vibes992000
@vibes992000 Жыл бұрын
Thanks a lot milan. Any comparison video for Docker Compose versus .Net Aspire ?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Not yet, but that's a great idea
@vibes992000
@vibes992000 Жыл бұрын
@@MilanJovanovicTechThanks for considering. Expecting it to be a detailed video on pros and cons of both worlds and if possible multiple cases where each fits best. Thanks in advance.
@usamabinahmed8012
@usamabinahmed8012 Жыл бұрын
Hi Milan , Where we can get this code example code available ? I think that will help new bees to get more things out of the concepts .
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
I share all the source code over on Patreon
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
But I'll see if I can release this pro-bono on GitHub, I agree it would be helpful
@sauravbhatta5303
@sauravbhatta5303 Жыл бұрын
I was working on the pragmatic course and facing the same configuration null error in docker run. Could be same server name issue. You should also add a video to run debugger in docker.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Did you manage to solve it?
@sauravbhatta5303
@sauravbhatta5303 Жыл бұрын
Checked it earlier. everything looks good and no problem locally but in Docker I am getting unhandled exception. ArgumentNullException: Value can’t be null. Parameter configuration. It’s at Infra.DI.AddInfrastructure(IConfiguration) Seems like not finding my appsetting.
@sauravbhatta5303
@sauravbhatta5303 Жыл бұрын
That error is gone by adding appsetting file to the project. But still my port does not show up in docker. Port 5001 is not visible. I can open swagger with the 5001 port. Any idea why it’s not picking up from the docker file or compose file.
@timur_skov
@timur_skov 5 күн бұрын
THANK YOU VERY MUCH!!!!! You really helped me.
@MilanJovanovicTech
@MilanJovanovicTech 5 күн бұрын
You're welcome!
@hamitkarahan2973
@hamitkarahan2973 Жыл бұрын
Hey Milan thanks for great explanation. I'd like to ask you that what is the difference using docker compose over just debugging our project from visual studio development environment? And do developers usually use docker compose in their local machines for debugging the project, or they using it in environments(Development, Staging or Production) also?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Just debugging won't start the containers you need
@timur2887
@timur2887 6 ай бұрын
What is the proper way to use contaniers for everything EXCEPT the web application? How to start postges and redis via docker-compose and api outside of it?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
I think the best answer to that you'll find in the docs for each relevant service.
@onosnow6500
@onosnow6500 9 ай бұрын
Hi Milan, thanks for the amazing video explaining the docker-compose. Just a very quick question, if I am using Amazon RDS, how to specify the volume (04:35)
@MilanJovanovicTech
@MilanJovanovicTech 9 ай бұрын
Isn't it a cloud service?
@Liumbert
@Liumbert 10 ай бұрын
oh man u r awesome, u won a new subscriber
@MilanJovanovicTech
@MilanJovanovicTech 10 ай бұрын
Welcome aboard!
@enciphered7650
@enciphered7650 Жыл бұрын
Would you ever recommend caching result sets ?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Result sets of what?
@enciphered7650
@enciphered7650 Жыл бұрын
A commonly loaded table. Let's say customer table.
@LucianDunca
@LucianDunca Жыл бұрын
The video is awesome so thank you for that and everything you are doing. However there are some points which are missing, or might be difficult for an average Jr-Mid developer to figure out by himself without accessing the source code... 1. Postgres setup and creating the database initial migration, with docker is hard to do this following your video; On short you need Postgres running in order to create your first migration 2. RedisCache part. I think you are relying on an extension that allows for the cache asside pattern, the Default GetAsync method in the IDistributedCache interface does only have the key and cancellation token as parameters. This might be on purpose to get people to want the source code :) Nontheless your vieos are great and an invaluable source of learning! Stay awesome!
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
It's more out of convenience - I already have videos on running EF migrations at startup and quite a few videos on caching, Redis, etc.
@respectmathias
@respectmathias 3 ай бұрын
How did you mount the volume locally, since there is a known issue with postgres and the windows file system e.g. "changing permissions of '/var/lib/postgresql/data': Operation not permitted", from what I've read you need to use a docker volume which is what I've done and works. But I would like to have it stored locally like you do.
@MilanJovanovicTech
@MilanJovanovicTech 3 ай бұрын
I didn't do anything other than what's shown in the video.
@PatricSjoeoe
@PatricSjoeoe Жыл бұрын
Really nice and easy explained! =)
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Glad you liked it!
@jamesreynolds3167
@jamesreynolds3167 Жыл бұрын
With the new container features in the build tools, you no longer need a docker file. You can configure it all within the csproj
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
That's a nice improvement. Maybe I'll make a YT short about it
@AbdusSalamAzad
@AbdusSalamAzad 7 ай бұрын
That is a great and simple explanation. Thanks @Milan
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Glad it was helpful!
@Tengri9090
@Tengri9090 11 ай бұрын
Docker container does not run when Visual Studio is closed. What am I doing wrong
@MilanJovanovicTech
@MilanJovanovicTech 11 ай бұрын
If you start it from VS - I'd expect it to also shut down with VS
@paolosartiano1454
@paolosartiano1454 Жыл бұрын
very thanks! fantastic your video!
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Glad it helped!
@antondoit
@antondoit 8 ай бұрын
Great as always
@MilanJovanovicTech
@MilanJovanovicTech 8 ай бұрын
Glad you think so!
@ricardk1443
@ricardk1443 10 күн бұрын
for me show the error volume sharing is not enabled when I tried to run by visual studio. I readed I should to enabled this in docker desktop but didnt have this option there
@MilanJovanovicTech
@MilanJovanovicTech 10 күн бұрын
Try running it from the command line instead, maybe that'll give more info.
@torrvic1156
@torrvic1156 3 ай бұрын
Thanks for another awesome video, dear Milan! But in my case I prefer using a secrets.json instead of appsettings.json. Is it possible to confer details of my connection string and other important configuration details somehow to my .NET WebApi container in compose.yaml file?
@MilanJovanovicTech
@MilanJovanovicTech 3 ай бұрын
Yes, check this: docs.docker.com/compose/how-tos/use-secrets/
@torrvic1156
@torrvic1156 3 ай бұрын
@@MilanJovanovicTech thank you so much Milan! Oh dear! This is exactly what I was looking for. Have no idea how did I managed to overlook it.
@andersjuul8310
@andersjuul8310 Жыл бұрын
Love it ❤
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Awesome, glad to hear that! 😁
@enis7x
@enis7x Жыл бұрын
When utilizing Docker, how do you create EF migrations? The environment variable I have placed in the Docker container for the database connection does not get read when I run EF commands. Except for doing EF migrations, the application functions as intended and the db-server connection is working fine.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Yeah, you'll have to use the actual connection strings for running migrations. You can specify it manually when running EF commands. learn.microsoft.com/en-us/ef/core/cli/powershell#update-database
@enis7x
@enis7x Жыл бұрын
@@MilanJovanovicTech That works when you are updating the database but not when you are trying to create migrations. I'm still trying to find a workaround for the problem but thanks for the help, at least it works with the update command.
@cleitoncarlospereira2006
@cleitoncarlospereira2006 Жыл бұрын
Hello Milan, how are you? When I run the application, the EF migration control table is created, however, the tables in the database are not created. Do I need to look at anything else?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Strange? The migrations are there? They're applied at startup - app.ApplyMigrations()
@petiriesz1916
@petiriesz1916 9 ай бұрын
Same for me, I'm using .net 8 maybe that caused the problem. I applied the migration via cli and it works.
@mad_t
@mad_t Жыл бұрын
It's a pity MS doesn't support podman (yet?), and you need extra actions to make it work with some limitations :(
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Yeah, that's annoying. I'll see if there's a nice solution for that, and maybe make another video.
@ahsansk84
@ahsansk84 4 ай бұрын
Your Api and database image tag is showing dev and latest respectively. But my all image tag is showing dev and also get an error. When I create an image using by Terminal, then tag shows latest. What is my problem.
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
I have no idea
@TrungTran-le2ht
@TrungTran-le2ht 11 ай бұрын
Thanks for the content. I have a question What is the benefit when using DbContext directly compare to Repository/UoW pattern ?
@MilanJovanovicTech
@MilanJovanovicTech 11 ай бұрын
Testability mostly, and code reuse (less duplication)
@khushi0831
@khushi0831 7 ай бұрын
Hi Milan, thanks for the video. but i have a postgres server and i need to specify the server name which is currently localhost. how or where do i need to specify that ? since it will be going to change on production server
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Through the connection string? It should be the Host value
@_miranHorvat
@_miranHorvat 10 ай бұрын
In a real world scenario your app is deployed to multiple on-prem instances. Each instance needs its own settings and when you spin up a new updated version it has to use the same settings. So, where do you put your settings?
@MilanJovanovicTech
@MilanJovanovicTech 10 ай бұрын
You want all of them to use the same settings? Why not something like Azure App Configuration?
@_miranHorvat
@_miranHorvat 10 ай бұрын
@@MilanJovanovicTech No. Different settings and local resources on different locations. When you update i.e. install a new version, it has to use the same settings as the old one.
@timur2887
@timur2887 8 ай бұрын
should you clear the cache on updates or just update the cache?
@MilanJovanovicTech
@MilanJovanovicTech 8 ай бұрын
Either one works fine. If you have the data ready, updating the cache makes sense.
@lourenceplay9017
@lourenceplay9017 Жыл бұрын
How would you cache a ddd class that only has private constructor and Create() static method? There will be an error related to deserializing. I stuck on this error: System.NotSupportedException: Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported.
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
JsonConstructor - or use a different type to cache
@Slyzor1
@Slyzor1 11 ай бұрын
What a great video, thank you very much!
@MilanJovanovicTech
@MilanJovanovicTech 11 ай бұрын
You're very welcome!
@muadgra3545
@muadgra3545 6 ай бұрын
Thank you, I have a question. The docker files are gone from the Docker Desktop when I close the visual studio. Do I need to run the program from the visual studio every time for it to be there?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
The images are cached, the containers are wiped
@baxram97
@baxram97 Жыл бұрын
But what if I have migration files?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
You can automate that part - like I'm doing here (for local development) and applying it via DbContext.Database.Migrate() Or create the migration scripts, and run them yourself
@timur2887
@timur2887 6 ай бұрын
when working with PostgreSQL containers you may use special docker-entrypoint-initdb.d volume to run initialization scripts inside newly created containers. They will be runned only once. You may use it to run any scripts on schema and/or import your data into database
@DaminGamerMC
@DaminGamerMC 11 ай бұрын
You can apply migrations with code like taht, but to add a migration you have to change the startup project which is kinda weird. Is there a better way?
@MilanJovanovicTech
@MilanJovanovicTech 11 ай бұрын
"dotnet ef" command line tool instead of using the VS console
@TheOverBack
@TheOverBack Жыл бұрын
So. Docker Compose is useful when you want to run the whole solution with their dependencies? But if I have 2 MVC apps, a background application with cron jobs, and a lot of broker consumers, they are dependent on db, Redis, rabbit, and mongoDB. And if I want to run one MVC website with consumers or another MVC app with jobs, do I have to create a lot of docker compose files to cover all combinations?
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
You can place all of them inside the same docker-compose setup
@shahidwani6445
@shahidwani6445 9 күн бұрын
Thanks milan sir
@MilanJovanovicTech
@MilanJovanovicTech 9 күн бұрын
Sure thing
@obasoroolakunleadeyemi
@obasoroolakunleadeyemi 7 ай бұрын
Hello, I have a .NET app and migration has not be run but want to connect it with a postgres database using docker-compose
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Hook into the container and create it manually
@nathangrosvenor7661
@nathangrosvenor7661 10 ай бұрын
What would you say is better and faster to get to production out of .NET Aspire and Docker Compose
@MilanJovanovicTech
@MilanJovanovicTech 10 ай бұрын
Aspire isn't meant for production workloads
@nathangrosvenor7661
@nathangrosvenor7661 10 ай бұрын
@@MilanJovanovicTech Makes sense
@baduy101
@baduy101 6 ай бұрын
Is there any chance that you can do same with SQL Server?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Just switch DB containers
@nemanjaspasic1242
@nemanjaspasic1242 7 ай бұрын
Hello Milan how do you use swagger when you start docker since its not in development environment anymore? How did you solve this? In program.cs i changed settings for publish but i think it shoud not be done like that? Can you share with me your solution?
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Start it from VS
@hieunguyendanh5302
@hieunguyendanh5302 2 ай бұрын
video very good, do you up video connect dockercompose with sql server, please help me
@MilanJovanovicTech
@MilanJovanovicTech 2 ай бұрын
Haven't made one
@reneellup7561
@reneellup7561 8 ай бұрын
Hi Sir. Is it possible to use a remote Docker host (in Linux VPS) to run this?
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Should be?
@shaheenlive
@shaheenlive 15 күн бұрын
await cache.GetAsync doesnt have an overload which takes 4 args why ?
@MilanJovanovicTech
@MilanJovanovicTech 14 күн бұрын
Check the docs
@shaheenlive
@shaheenlive 13 күн бұрын
@@MilanJovanovicTech I did, with .Net9 , there is only two arguments, I followed a different video of your and created an extension method that basically does the same but do not take ct as an arg, for sample purposes it worked for me
@ivandrofly
@ivandrofly 10 ай бұрын
4:59 - Connection string dns-naming
@MilanJovanovicTech
@MilanJovanovicTech 10 ай бұрын
Hmm?
@sanampakuwal
@sanampakuwal 7 ай бұрын
I am getting this error: initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
How's that happening?
@sanampakuwal
@sanampakuwal 7 ай бұрын
@@MilanJovanovicTech nvm I found solution in some github thread, I need to exclude data from there like /postgresql/data is not working whereas postgresql/anything is working.
@xanhxanh5097
@xanhxanh5097 6 ай бұрын
thanks great video
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Any time! :)
@MateStier-hd4nv
@MateStier-hd4nv 11 ай бұрын
What kind of postgres gui do you use?:)
@MilanJovanovicTech
@MilanJovanovicTech 11 ай бұрын
Usually just DBeaver
@andor7323
@andor7323 10 ай бұрын
I followed the steps but then I removed the docker-compose file and trying to add it back again but whatever I do I get this error "Unable to find any supported orchestrators for this type of project" any ideas?
@MilanJovanovicTech
@MilanJovanovicTech 10 ай бұрын
No idea, haven't seen that issue before
@andor7323
@andor7323 10 ай бұрын
@@MilanJovanovicTech Got it to work! Had to remove all the docker compose configuration and also go inside the project folder and remove all the docker related files that had been created. They didnt get removed automatically when I removed the docker compose project that's what caused the issue.
@tienviet7442
@tienviet7442 10 ай бұрын
what is theme you are using in vs?
@MilanJovanovicTech
@MilanJovanovicTech 10 ай бұрын
ReSharper
@MalleshwarRao-m5v
@MalleshwarRao-m5v 11 ай бұрын
Please publish a video by adding docker support for your CQRS pattern project(Gatherly)
@MilanJovanovicTech
@MilanJovanovicTech 11 ай бұрын
Just follow the same idea from here 😅
@amimridul4278
@amimridul4278 8 ай бұрын
Just awesome
@MilanJovanovicTech
@MilanJovanovicTech 8 ай бұрын
Thanks!
@minimalstory
@minimalstory 8 ай бұрын
good!!!
@MilanJovanovicTech
@MilanJovanovicTech 8 ай бұрын
Thanks!!
@lettuceturnipthebeets790
@lettuceturnipthebeets790 Жыл бұрын
just when Nana posted her Zero-to-Hero vid on Docker Compose 😅 looks suss jk jk it's fine to take inspiration from others)
@MilanJovanovicTech
@MilanJovanovicTech Жыл бұрын
Pretty cool, thanks for introducing me to a new tech channel on YT 😅 P.S. I can show you this was recorded December 12th last year. I typically have one-two months of videos scheduled ahead.
@harkiratsingh4947
@harkiratsingh4947 Жыл бұрын
Milan is right , I have been following him over 1 year now and I have seen docker before as well. Milan is Azure AD B2C in your plan as well for sometime ahead ?
@pulsar1934
@pulsar1934 24 күн бұрын
This won't work requires https certificate
@MilanJovanovicTech
@MilanJovanovicTech 24 күн бұрын
Run it from Visual Studio
@ChandanDey-cw4zq
@ChandanDey-cw4zq 10 ай бұрын
Hi, I'm getting following error Npgsql.NpgsqlException: 'Failed to connect to 172.18.0.3:5432' public static class MigrationExtensions { public static void ApplyMigrations(this IApplicationBuilder app) { using IServiceScope scope = app.ApplicationServices.CreateScope(); using ApplicationDbContext dbContext = scope.ServiceProvider.GetRequiredService(); dbContext.Database.Migrate(); // error here } }
@ChandanDey-cw4zq
@ChandanDey-cw4zq 10 ай бұрын
It's working. After second time execute
@MilanJovanovicTech
@MilanJovanovicTech 10 ай бұрын
Probably DB did not start
@timur2887
@timur2887 6 ай бұрын
you may healthscheck the postgres container and wait on statring you application in docker compose service dependency for service_healthy services: api: ... depends_on: server: condition: service_healthy server: ... healthcheck: test: ["CMD-SHELL", "pg_isready -d -U "] interval: 5s timeout: 5s retries: 5 start_period: 30s
@miguelalves8209
@miguelalves8209 3 күн бұрын
@@timur2887 Dude, thanks so much you and @MilanJovanovicTech, I was struggling for days with my project to work with migrations and orchestration! You guys are awesome! xD
Docker Compose Tutorial
33:02
Programming with Mosh
Рет қаралды 476 М.
Dockerize Your .NET Application in 5 Minutes!
7:42
Amichai Mantinband
Рет қаралды 23 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
EF Core Multitenancy For Your SaaS Applications
14:41
Milan Jovanović
Рет қаралды 29 М.
100+ Docker Concepts you Need to Know
8:28
Fireship
Рет қаралды 1,1 МЛН
Migrating From Docker Compose to .NET Aspire (my experience)
17:01
Milan Jovanović
Рет қаралды 18 М.
How To Build Loosely Coupled Microservices With MassTransit
23:01
Milan Jovanović
Рет қаралды 41 М.
3 ways to reduce the size of your docker images
17:20
Raghav Dua
Рет қаралды 25 М.
First Look at .NET Aspire - Distributed Applications in .NET 8
12:56
Milan Jovanović
Рет қаралды 38 М.
CQRS Doesn't Have To Be Complicated | Clean Architecture, .NET 6
24:09
Milan Jovanović
Рет қаралды 120 М.
Ultimate Docker Compose Tutorial
1:03:14
TechWorld with Nana
Рет қаралды 232 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН