2025-08-01 15:48:20 +02:00
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
|
2025-07-06 19:15:24 +02:00
|
|
|
var builder = DistributedApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
var cache = builder.AddRedis("cache");
|
|
|
|
|
|
2025-08-01 15:48:20 +02:00
|
|
|
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);
|
2025-07-06 19:15:24 +02:00
|
|
|
|
|
|
|
|
builder.AddProject<Projects.PresentPortal_Web>("webfrontend")
|
2025-08-01 15:48:20 +02:00
|
|
|
.WithExternalHttpEndpoints()
|
|
|
|
|
.WithReference(cache)
|
|
|
|
|
.WaitFor(cache)
|
|
|
|
|
.WithReference(apiService)
|
|
|
|
|
.WaitFor(apiService);
|
2025-07-06 19:15:24 +02:00
|
|
|
|
|
|
|
|
builder.Build().Run();
|