mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
hardcode data path for simplicity
This commit is contained in:
parent
1e2fd1c3fa
commit
7f592a8ef4
2 changed files with 9 additions and 9 deletions
|
|
@ -4,7 +4,6 @@
|
|||
# init base
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine as base
|
||||
WORKDIR /app
|
||||
ENV DataDirectory__Path "data"
|
||||
ENV ASPNETCORE_URLS "http://*:5000"
|
||||
EXPOSE 5000
|
||||
ENTRYPOINT ["dotnet", "FilterLists.Api.dll"]
|
||||
|
|
|
|||
|
|
@ -3,28 +3,29 @@
|
|||
using FilterLists.Data.Seed.Extensions;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace FilterLists.Api
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
private const string DataPath = "data";
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateWebHostBuilder(args)
|
||||
.Build()
|
||||
.MigrateAndSeedDbContext<FilterListsDbContext>((context, service) =>
|
||||
{
|
||||
var dataPath = service.GetService<IConfiguration>()["DataDirectory:Path"].ToString();
|
||||
SeedFilterListsDbContext.SeedOrUpdateAsync(context, dataPath).Wait();
|
||||
SeedFilterListsDbContext.SeedOrUpdateAsync(context, DataPath).Wait();
|
||||
})
|
||||
.Run();
|
||||
}
|
||||
|
||||
private static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseApplicationInsights()
|
||||
.UseStartup<Startup>();
|
||||
private static IWebHostBuilder CreateWebHostBuilder(string[] args)
|
||||
{
|
||||
return WebHost.CreateDefaultBuilder(args)
|
||||
.UseApplicationInsights()
|
||||
.UseStartup<Startup>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue