Files
vegasco/src/Vegasco.Server.AppHost/Program.cs

24 lines
769 B
C#
Raw Normal View History

using Vegasco.Server.AppHost.Shared;
IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args);
IResourceBuilder<PostgresDatabaseResource> postgres = builder.AddPostgres(Constants.Database.ServiceName)
2025-06-12 19:12:26 +02:00
.WithLifetime(ContainerLifetime.Persistent)
.WithDataVolume()
.AddDatabase(Constants.Database.Name);
2025-06-13 20:12:43 +02:00
IResourceBuilder<ProjectResource> api = builder
.AddProject<Projects.Vegasco_Server_Api>(Constants.Projects.Api)
.WithReference(postgres)
.WaitFor(postgres);
2025-06-13 20:12:43 +02:00
builder
.AddNpmApp("Vegasco-Web", "../Vegasco-Web", scriptName: "start:withInstall")
2025-06-13 20:12:43 +02:00
.WithReference(api)
.WaitFor(api)
.WithHttpEndpoint(port: 44200, env: "PORT", isProxied: false)
.WithExternalHttpEndpoints()
.WithHttpHealthCheck("/", 200);
2025-06-13 20:12:43 +02:00
builder.Build().Run();