I can browse to the API at a test endpoint (the API is bound to port 49501 in the docker compose file) If I go to the directory containing docker-compose.yml file and run docker-compose up -d "ConnectionStrings:LearningAnalyticsAPIContext=Server=db Port=4000 Database=LearningAnalytics User=root SslMode=None ConnectionReset=false connect timeout=3600" Image: dockersamples/tidb:nanoserver-sac2016ĭockerfile: LearningAnalytics.API\Dockerfile RUN dotnet publish "" -c Release -o /app/publishĮNTRYPOINT Īnd there is a docker-compose.yml file to bring up the API container above and the database …. RUN dotnet build "" -c Release -o /app/build RUN dotnet restore "LearningAnalytics.API/" The DockerFile is FROM /dotnet/core/aspnet:3.1-nanoserver-1903 AS baseįROM /dotnet/core/sdk:3.1-nanoserver-1903 AS buildĬOPY Deploying into Docker without migrations. It’s just what I’m tinkering around with at the moment. The demo project is called Learning Analytics and it’s simple student management application. Net Core and MySQL you could use Linux as well if needed. The docker containers are Windows, though as it’s. I’ll also touch on how you would do it with Entity Framework 6. Net Core 3 API with Entity Framework Core and the database is MySQL. I know that most people just want the answer – so if that’s you then just jump to the end and it’s there. I’m going to go through the failed attempts as I think they are instructive. My idea was that EF migrations should be a straightforward way to initialise a database. This will create and populate the database with the correct schema and reference data. I’m going to run through how to deploy an API and a database into two separate Docker containers then apply Entity Framework migrations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |