Very nice, things are explained very clearly. A video about EF Core migrations & running them on a database inside a container would be sweet. So that when we run docker-compose, the required db is initialized & migrations executed.
@ades39674 жыл бұрын
Very pragmatic example! Great explanations as you're typing. Thank you
@Lazzarus73 жыл бұрын
Thanks, great explanation, simple and clear and in a short video
@renatorcribeiro5 жыл бұрын
Seus videos são muito bons. Aprendo muito com eles. Obrigado por compartilhar seus conhecimentos. Sou do Brasil.
@jeremygraham77865 жыл бұрын
Hey mate, thanks for the great series, enjoying it lots. I came across an issue at this section which I would appreciated your thoughts on. Basically when I spun up the api and sql db with docker-compose, it wasn't applying the migrations to the sql database and therefore wasn't creating a database when running in the container. To fix, I had to force migrations when the api was built in order for it to work... Do you know why I had to force migrations while yours seems to do it automatically...?
@florianrefardt2454 жыл бұрын
I had the exact same issue. The API was running but the database was not ready because the migration is not executed. I found this solution here to work around it: codebuckets.com/2020/08/14/applying-entity-framework-migrations-to-a-docker-container/
@swaroopshivanna30253 жыл бұрын
May be because @nick had written bunch of code in Program.cs to apply migration as the application starts (in his earlier video) and you might not have done that. I am just guessing though I could be totally wrong.
@diale133 жыл бұрын
Works great with postman but i cant see swagger on the browser, any ideas why? I mean i use the same url (without swagger/index.html) and postman works so docker is ok, no idea why
@fedemartinez983 жыл бұрын
The same is happening to me, please help!
@diale133 жыл бұрын
Fixed it: added this line to docker compose as swagger needs to be running in env. environment: - ASPNETCORE_ENVIRONMENT=Development Great video as allways nick
@fedemartinez983 жыл бұрын
@@diale13 Thanks man! The day I get my engineer degree I will remember you!
@naveensemwall4 жыл бұрын
Every thing works fine but not able to browse the hosted api URL in the browser. Like while browsing localhost:9006/api/v1/posts , browser is showing >> This site can’t be reached. I have mapped 9006:80 in docker-compose file. I am using Windows 10 Pro and Docker desktop community edition. Do i need to do some kind of mapping anywhere for this ?
@mguollo13 жыл бұрын
Can't work here, same issue. My browser dont acess localhost:7000. Did you find a solution?
@joepadz20015 жыл бұрын
very helpful thanks bro.
@sakshock5 жыл бұрын
Great video ! Thanks!
@psdeep24 жыл бұрын
Thanks for the tutorial. There is warning that data will be lost when we destroy the container. Is there any way to fix data persistent problem?
@JanithWidarshana5 жыл бұрын
How about if we need to have basic data to insert. Is it possible to do via docker compose ?
@luizmedina57194 жыл бұрын
Hi how implement https in dockercompose ?
@shironii9975 жыл бұрын
hi nick, great video, i have a little question about the dockerfile in case that the api to run in docker depends of multiple custom libraries, how must i to implement the dockerfile in that case?
@nickchapsas5 жыл бұрын
Hey, can you please elaborate on what you mean by "custom libraries"? Isn't that something living in nuget?
@MarcoLeite5 жыл бұрын
@@nickchapsas I have teh same isso. My solution has a main project with 2 dependent class libraries
@acousticbrothers14915 жыл бұрын
@@nickchapsas I think he is asking if you have a "N-Layer" Architecture
@dinand64105 жыл бұрын
Thank you Nick all very helpfull. Only this one did not do the job. Not even with your demoproject. (btw is it possible, next time to have democode per lesson. Now one mistake knocks my code out of all future lessons.) Keep it on, I will stay to enjoy it.
@oguzhan11915 жыл бұрын
Hi, did you create the database or docker.yml created the database?
@nickchapsas5 жыл бұрын
The application itself created the database. The Program.cs contains a migration executer
@17madjoker475 жыл бұрын
Thanks a lot, very usefull video =)
@kalaiselvank76434 жыл бұрын
hi ,ERROR: Service 'main-api' failed to build: COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder252996948/Tweetbook.csproj: no such file or directory i am getting this error any usggestion
@annagulina59545 жыл бұрын
ERROR: Service 'main-api' failed to build: image operating system "windows" cannot be used on this platform What can I do? thank you
@nickchapsas5 жыл бұрын
This happens because you need to switch your docker configuration to be on Linux containers.
@joseantoniosanchesgarcia92204 жыл бұрын
i don't undertand this part "server=localhost,1400...etc" what is 1400, a port or what?
@nickchapsas4 жыл бұрын
Yeah that's a port
@joseantoniosanchesgarcia92204 жыл бұрын
@@nickchapsas is it any port?, thanks for your answer
@joseantoniosanchesgarcia92204 жыл бұрын
@@nickchapsas i got this error, An error occurred using the connection to database 'PlazaCoreMiddle' on server 'DESKTOP-8TUFUVF'. fail: Microsoft.EntityFrameworkCore.Query[10100] An exception occurred while iterating over the results of a query for context type 'PlazaCoreMiddleBack.Data.ApplicationDbContext'. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.