From d67025d49730bf17c9e83f81f102506ca02d3b24 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 14 Mar 2024 16:48:24 +0100 Subject: [PATCH] add --- src/HeartTrackAPI/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/HeartTrackAPI/Dockerfile b/src/HeartTrackAPI/Dockerfile index 560ddd2..a198123 100644 --- a/src/HeartTrackAPI/Dockerfile +++ b/src/HeartTrackAPI/Dockerfile @@ -22,6 +22,12 @@ COPY ["StubbedContextLib/StubbedContextLib.csproj", "StubbedContextLib/"] RUN dotnet restore "HeartTrackAPI/HeartTrackAPI.csproj" COPY . . +# Add the migrations +RUN dotnet ef migrations add MyMigrations --project StubbedContextLib/ --context TrainingStubbedContext + +# Update the database +RUN dotnet ef database update --project StubbedContextLib/ --context TrainingStubbedContext --startup-project HeartTrackAPI/ + WORKDIR "/src/HeartTrackAPI" RUN ls RUN dotnet build "HeartTrackAPI.csproj" -c $BUILD_CONFIGURATION -o /app/build @@ -30,12 +36,6 @@ FROM build AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "HeartTrackAPI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false -# Add the migrations -RUN dotnet ef migrations add MyMigrations --project StubbedContextLib/ --context TrainingStubbedContext - -# Update the database -RUN dotnet ef database update --project StubbedContextLib/ --context TrainingStubbedContext --startup-project HeartTrackAPI/ - FROM base AS final WORKDIR /app COPY --from=publish /app/publish .