|
|
|
@ -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 .
|
|
|
|
|