Medusa.net/Medusa.AppHost/Program.cs
2024-08-15 20:06:56 +02:00

39 lines
1012 B
C#

using Aspire.Hosting;
using Medusa.AppHost;
var builder = DistributedApplication.CreateBuilder(args);
var weburl = builder.AddParameter("weburl");
var dbVolumeName = "MedusaDB";
var cache = builder.AddRedis("cache")
.WithRedisCommander()
.WithOtlpExporter();
var postgres = builder.AddPostgres("database", password: builder.AddParameter("dbPass", true))
.WithDataVolume(dbVolumeName)
.WithPgAdmin()
.WithOtlpExporter();
var messenger = builder.AddRabbitMQ("messenger")
.WithManagementPlugin()
.WithOtlpExporter();
var medusaDB = postgres.AddDatabase(dbVolumeName);
builder.AddProject<Projects.Medusa_Core>("Medusa-core")
.WithReference(cache)
.WithReference(messenger)
.WithEnvironment("weburl", weburl);
builder.AddProject<Projects.Medusa_Web_Server>("Medusa-web-server");
builder.AddProject<Projects.Medusa_Data>("medusa-data")
.WithReference(cache)
.WithReference(messenger)
.WithReference(medusaDB)
.WaitOn(postgres);
builder.Build().Run();