26 lines
707 B
C#
26 lines
707 B
C#
var builder = DistributedApplication.CreateBuilder(args);
|
|
|
|
var postgresPassword = builder.AddParameter("postgres-password", secret: true);
|
|
|
|
// Infra
|
|
var postgres = builder.AddPostgres("postgres")
|
|
.WithDataVolume("recnet-postgres-data")
|
|
.WithLifetime(ContainerLifetime.Persistent)
|
|
.WithPassword(postgresPassword)
|
|
.WithHostPort(5432)
|
|
.WithPgAdmin();
|
|
|
|
var db = postgres.AddDatabase("recnet");
|
|
|
|
// Services
|
|
var migrationService = builder.AddProject<Projects.RecNet_MigrationService>("migrationservice")
|
|
.WithReference(db)
|
|
.WaitFor(db);
|
|
|
|
builder.AddProject<Projects.API>("api")
|
|
.WithReference(db)
|
|
.WaitFor(db)
|
|
.WaitForCompletion(migrationService);
|
|
|
|
builder.Build().Run();
|