Scaffold some identity stuff and switch to postgres
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0"/>
|
||||
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
@@ -12,12 +12,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PresentPortal.ApiService\PresentPortal.ApiService.csproj"/>
|
||||
<ProjectReference Include="..\PresentPortal.Web\PresentPortal.Web.csproj"/>
|
||||
<ProjectReference Include="..\PresentPortal.ApiService\PresentPortal.ApiService.csproj" />
|
||||
<ProjectReference Include="..\PresentPortal.Web\PresentPortal.Web.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aspire.Hosting.AppHost" />
|
||||
<PackageReference Include="Aspire.Hosting.PostgreSQL" />
|
||||
<PackageReference Include="Aspire.Hosting.Redis" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,14 +1,31 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
var builder = DistributedApplication.CreateBuilder(args);
|
||||
|
||||
var cache = builder.AddRedis("cache");
|
||||
|
||||
var apiService = builder.AddProject<Projects.PresentPortal_ApiService>("apiservice");
|
||||
IResourceBuilder<PostgresServerResource> postgresBuilder = builder.AddPostgres("postgres")
|
||||
.WithLifetime(ContainerLifetime.Persistent)
|
||||
.WithDataVolume();
|
||||
|
||||
if (builder.Environment.IsDevelopment())
|
||||
{
|
||||
postgresBuilder = postgresBuilder
|
||||
.WithPgWeb();
|
||||
}
|
||||
|
||||
IResourceBuilder<PostgresDatabaseResource> postgres = postgresBuilder
|
||||
.AddDatabase("presentportal");
|
||||
|
||||
var apiService = builder.AddProject<Projects.PresentPortal_ApiService>("apiservice")
|
||||
.WithReference(postgres)
|
||||
.WaitFor(postgres);
|
||||
|
||||
builder.AddProject<Projects.PresentPortal_Web>("webfrontend")
|
||||
.WithExternalHttpEndpoints()
|
||||
.WithReference(cache)
|
||||
.WaitFor(cache)
|
||||
.WithReference(apiService)
|
||||
.WaitFor(apiService);
|
||||
.WithExternalHttpEndpoints()
|
||||
.WithReference(cache)
|
||||
.WaitFor(cache)
|
||||
.WithReference(apiService)
|
||||
.WaitFor(apiService);
|
||||
|
||||
builder.Build().Run();
|
||||
Reference in New Issue
Block a user