Add profiles domain, infra, API endpoints
This commit is contained in:
@@ -1,8 +1,25 @@
|
||||
using Aspire.Hosting;
|
||||
|
||||
var builder = DistributedApplication.CreateBuilder(args);
|
||||
|
||||
var postgres = builder.AddPostgres("postgres");
|
||||
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");
|
||||
|
||||
builder.Build().Run();
|
||||
// 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();
|
||||
|
||||
Reference in New Issue
Block a user