Files

31 lines
832 B
C#
Raw Permalink Normal View History

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