2024-08-13 07:55:18 +00:00
|
|
|
using Aspire.Hosting;
|
2024-08-15 18:06:56 +00:00
|
|
|
using Medusa.AppHost;
|
2024-08-13 07:55:18 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2024-08-13 07:55:18 +00:00
|
|
|
builder.AddProject<Projects.Medusa_Core>("Medusa-core")
|
2024-08-15 18:06:56 +00:00
|
|
|
.WithReference(cache)
|
|
|
|
.WithReference(messenger)
|
2024-08-19 07:26:41 +00:00
|
|
|
.WithEnvironment("weburl", weburl)
|
|
|
|
.WithEnvironment("rabbitHostName", messenger)
|
|
|
|
.WaitOn(messenger);
|
2024-08-13 07:55:18 +00:00
|
|
|
|
|
|
|
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)
|
2024-08-19 07:26:41 +00:00
|
|
|
.WithEnvironment("rabbitHostName", messenger)
|
|
|
|
.WaitOn(postgres)
|
|
|
|
.WaitOn(messenger);
|
2024-08-15 18:06:56 +00:00
|
|
|
|
2024-08-13 07:55:18 +00:00
|
|
|
builder.Build().Run();
|