[PROD] Add seq support #7

Merged
thomas.nuyken merged 5 commits from main into production 2025-08-19 18:56:11 +02:00
4 changed files with 20 additions and 1 deletions
Showing only changes of commit c365af1d42 - Show all commits

View File

@@ -18,6 +18,8 @@ public static class DependencyInjectionExtensions
/// <param name="builder"></param>
public static void AddApiServices(this IHostApplicationBuilder builder)
{
builder.AddBuilderServices();
builder.Services
.AddMiscellaneousServices()
.AddCustomOpenApi()
@@ -27,6 +29,13 @@ public static class DependencyInjectionExtensions
builder.AddDbContext();
}
private static IHostApplicationBuilder AddBuilderServices(this IHostApplicationBuilder builder)
{
builder.AddSeqEndpoint("seq");
return builder;
}
private static IServiceCollection AddMiscellaneousServices(this IServiceCollection services)
{
services.AddSingleton(() =>

View File

@@ -14,6 +14,7 @@
<PackageReference Include="Asp.Versioning.Http" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.3.0" />
<PackageReference Include="Aspire.Seq" Version="9.3.1" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />

View File

@@ -14,13 +14,21 @@ if (builder.Environment.IsDevelopment())
.WithPgAdmin();
}
IResourceBuilder<SeqResource> seq = builder.AddSeq("seq")
.WithLifetime(ContainerLifetime.Persistent)
.WithDataVolume()
.WithExternalHttpEndpoints()
.WithImageTag("latest");
IResourceBuilder<PostgresDatabaseResource> postgres = postgresBuilder
.AddDatabase(Constants.Database.Name);
IResourceBuilder<ProjectResource> api = builder
.AddProject<Projects.Vegasco_Server_Api>(Constants.Projects.Api)
.WithReference(postgres)
.WaitFor(postgres);
.WaitFor(postgres)
.WithReference(seq)
.WaitFor(seq);
builder
.AddNpmApp("Vegasco-Web", "../Vegasco-Web")

View File

@@ -18,6 +18,7 @@
<PackageReference Update="Nerdbank.GitVersioning">
<Version>3.7.115</Version>
</PackageReference>
<PackageReference Include="Aspire.Hosting.Seq" Version="9.3.1" />
</ItemGroup>
<ItemGroup>