Building out navigation in the admin site
This commit is contained in:
@@ -5,7 +5,6 @@ EXPOSE 8080
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["src/api/MicCheck.Api/MicCheck.Api.csproj", "src/api/MicCheck.Api/"]
|
||||
COPY ["src/infrastructure/MicCheck.Infrastructure/MicCheck.Infrastructure.csproj", "src/infrastructure/MicCheck.Infrastructure/"]
|
||||
RUN dotnet restore "src/api/MicCheck.Api/MicCheck.Api.csproj"
|
||||
COPY . .
|
||||
RUN dotnet build "src/api/MicCheck.Api/MicCheck.Api.csproj" -c Release -o /app/build
|
||||
|
||||
@@ -146,6 +146,13 @@ try
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Apply any pending EF Core migrations on startup (safe to run on every boot)
|
||||
using (var migrationScope = app.Services.CreateScope())
|
||||
{
|
||||
var db = migrationScope.ServiceProvider.GetRequiredService<MicCheckDbContext>();
|
||||
await db.Database.MigrateAsync();
|
||||
}
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.MapOpenApi();
|
||||
|
||||
Reference in New Issue
Block a user