Medusa.net/Medusa.AppHost/Program.cs

43 lines
1.1 KiB
C#
Raw Normal View History

using Aspire.Hosting;
2024-08-15 18:06:56 +00:00
using Medusa.AppHost;
var builder = DistributedApplication.CreateBuilder(args);
var weburl = builder.AddParameter("weburl");
2024-08-15 18:06:56 +00:00
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")
2024-08-15 18:06:56 +00:00
.WithReference(cache)
.WithReference(messenger)
.WithEnvironment("weburl", weburl)
.WithEnvironment("rabbitHostName", messenger)
.WaitOn(messenger);
builder.AddProject<Projects.Medusa_Web_Server>("Medusa-web-server");
2024-08-15 18:06:56 +00:00
builder.AddProject<Projects.Medusa_Data>("medusa-data")
.WithReference(cache)
.WithReference(messenger)
.WithReference(medusaDB)
.WithEnvironment("rabbitHostName", messenger)
.WaitOn(postgres)
.WaitOn(messenger);
2024-08-15 18:06:56 +00:00
builder.Build().Run();