Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 252e685d2e | |||
| 7b80d2e071 | |||
| 25c937e41c |
@@ -3,53 +3,27 @@ using Scalar.Aspire;
|
|||||||
|
|
||||||
var builder = DistributedApplication.CreateBuilder(args);
|
var builder = DistributedApplication.CreateBuilder(args);
|
||||||
|
|
||||||
#region MINIO
|
#region EXTERNAL CONNECTIONS — OPC infra (postgres, minio)
|
||||||
var minio = builder.AddMinioContainer("minio");
|
// Connection strings are declared in appsettings.Development.json and point at the
|
||||||
|
// fdev tenant on the shared OPC platform infra running via OPC/infra/docker-compose.yml.
|
||||||
|
var postgresdb = builder.AddConnectionString("postgresdb");
|
||||||
|
var minio = builder.AddConnectionString("minio");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region REDIS
|
#region REDIS
|
||||||
var cache = builder.AddRedis("cache");
|
var cache = builder.AddRedis("cache");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region POSTGRESQL AND PGADMIN
|
|
||||||
var postgres = builder.AddPostgres("postgres")
|
|
||||||
.WithLifetime(ContainerLifetime.Persistent)
|
|
||||||
.WithHostPort(5432)
|
|
||||||
.WithPgAdmin();
|
|
||||||
|
|
||||||
var postgresdb = postgres.AddDatabase("postgresdb");
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region KEYCLOAK
|
|
||||||
var keycloakDb = postgres.AddDatabase("authdb");
|
|
||||||
|
|
||||||
var keycloak = builder.AddKeycloak("keycloak", 8080)
|
|
||||||
.WithEnvironment(async ctx =>
|
|
||||||
{
|
|
||||||
var connString = await keycloakDb.Resource.ConnectionStringExpression.GetValueAsync(CancellationToken.None);
|
|
||||||
var conn = new Npgsql.NpgsqlConnectionStringBuilder(connString);
|
|
||||||
ctx.EnvironmentVariables["KC_DB"] = "postgres";
|
|
||||||
ctx.EnvironmentVariables["KC_DB_URL"] = $"jdbc:postgresql://postgres:5432/{keycloakDb.Resource.DatabaseName}";
|
|
||||||
ctx.EnvironmentVariables["KC_DB_USERNAME"] = conn.Username!;
|
|
||||||
ctx.EnvironmentVariables["KC_DB_PASSWORD"] = conn.Password!;
|
|
||||||
})
|
|
||||||
.WaitFor(keycloakDb)
|
|
||||||
.WithRealmImport("KeycloakConfig/");
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region EFCORE MIGRATION WORKER
|
#region EFCORE MIGRATION WORKER
|
||||||
var migrations = builder.AddProject<Projects.Clarity_MigrationService>("clarity-migrationservice")
|
var migrations = builder.AddProject<Projects.Clarity_MigrationService>("clarity-migrationservice")
|
||||||
.WithReference(postgresdb)
|
.WithReference(postgresdb);
|
||||||
.WaitFor(postgresdb);
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region REST API
|
#region REST API
|
||||||
var server = builder.AddProject<Projects.Clarity_Server>("server")
|
var server = builder.AddProject<Projects.Clarity_Server>("server")
|
||||||
.WaitFor(keycloak)
|
|
||||||
.WithReference(cache)
|
.WithReference(cache)
|
||||||
.WithReference(postgresdb)
|
.WithReference(postgresdb)
|
||||||
.WaitFor(cache)
|
.WaitFor(cache)
|
||||||
.WaitFor(postgresdb)
|
|
||||||
.WithReference(migrations)
|
.WithReference(migrations)
|
||||||
.WithReference(minio)
|
.WithReference(minio)
|
||||||
.WaitForCompletion(migrations)
|
.WaitForCompletion(migrations)
|
||||||
@@ -60,11 +34,10 @@ var server = builder.AddProject<Projects.Clarity_Server>("server")
|
|||||||
|
|
||||||
#region REACT
|
#region REACT
|
||||||
var webfrontend = builder.AddViteApp("webfrontend", "../frontend")
|
var webfrontend = builder.AddViteApp("webfrontend", "../frontend")
|
||||||
.WaitFor(keycloak)
|
|
||||||
.WithReference(server)
|
.WithReference(server)
|
||||||
.WaitFor(server)
|
.WaitFor(server)
|
||||||
.WithEnvironment("VITE_KEYCLOAK_URL", keycloak.GetEndpoint("http"))
|
.WithEnvironment("VITE_KEYCLOAK_URL", "https://keycloak.clarity.test")
|
||||||
.WithEnvironment("VITE_KEYCLOAK_REALM", "clarity")
|
.WithEnvironment("VITE_KEYCLOAK_REALM", "clarity-fdev-app-clarity-01000000")
|
||||||
.WithEnvironment("VITE_KEYCLOAK_CLIENT_ID", "clarity-web-app");
|
.WithEnvironment("VITE_KEYCLOAK_CLIENT_ID", "clarity-web-app");
|
||||||
|
|
||||||
server.PublishWithContainerFiles(webfrontend, "wwwroot");
|
server.PublishWithContainerFiles(webfrontend, "wwwroot");
|
||||||
|
|||||||
@@ -4,5 +4,9 @@
|
|||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"postgresdb": "Host=localhost;Port=5432;Database=clarity_fdev_app_clarity_01000000;Username=postgres;Password=postgres",
|
||||||
|
"minio": "Endpoint=http://localhost:9000/;AccessKey=minioadmin;SecretKey=minioadmin"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,14 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"Keycloak": {
|
||||||
"postgresdb": "Host=localhost;Port=56235;Database=postgresdb;Username=postgres;Password=WdW+Q3wzq.Ssuzq6rT4A}_"
|
"Realm": "clarity-fdev-app-clarity-01000000",
|
||||||
}
|
"BaseUrl": "https://keycloak.clarity.test",
|
||||||
|
"InternalUrl": "http://localhost:8080"
|
||||||
|
},
|
||||||
|
"Vault": {
|
||||||
|
"Address": "http://localhost:8200",
|
||||||
|
"Token": "hvs.YLYBCUXgeJM3Gq4C10tWBWjw"
|
||||||
|
},
|
||||||
|
"Tenant__Id": "fdev-app-clarity-01000000"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
|
</PropertyGroup>
|
||||||
|
<!-- Aspire Packages -->
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="13.2.2" />
|
||||||
|
<PackageVersion Include="Aspire.Keycloak.Authentication" Version="13.2.2-preview.1.26207.2" />
|
||||||
|
<PackageVersion Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="13.2.2" />
|
||||||
|
<PackageVersion Include="Aspire.StackExchange.Redis.OutputCaching" Version="13.2.2" />
|
||||||
|
<PackageVersion Include="Aspire.Hosting.JavaScript" Version="13.2.2" />
|
||||||
|
<PackageVersion Include="Aspire.Hosting.Keycloak" Version="13.2.2-preview.1.26207.2" />
|
||||||
|
<PackageVersion Include="Aspire.Hosting.Redis" Version="13.2.2" />
|
||||||
|
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Minio" Version="13.2.1-beta.532" />
|
||||||
|
<PackageVersion Include="CommunityToolkit.Aspire.Minio.Client" Version="13.2.1-beta.532" />
|
||||||
|
<PackageVersion Include="Docker.DotNet" Version="3.125.15" />
|
||||||
|
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.6" />
|
||||||
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.6" />
|
||||||
|
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.6" />
|
||||||
|
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.7" />
|
||||||
|
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.7" />
|
||||||
|
<PackageVersion Include="Npgsql" Version="10.0.2" />
|
||||||
|
<PackageVersion Include="LibGit2Sharp" Version="0.31.0" />
|
||||||
|
<PackageVersion Include="Scalar.Aspire" Version="0.9.24" />
|
||||||
|
<PackageVersion Include="VaultSharp" Version="1.17.5.1" />
|
||||||
|
<PackageVersion Include="Yarp.ReverseProxy" Version="2.3.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<!-- Clarity.MigrationService -->
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.6" />
|
||||||
|
</ItemGroup>
|
||||||
|
<!-- Clarity.Server -->
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.6" />
|
||||||
|
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.5.0" />
|
||||||
|
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="10.5.0" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.2" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.15.2" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.1" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.15.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.4110890">
|
<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/1.0.4902498">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ShouldRunNpmInstall>false</ShouldRunNpmInstall>
|
<ShouldRunNpmInstall>false</ShouldRunNpmInstall>
|
||||||
<ShouldRunBuildScript>false</ShouldRunBuildScript>
|
<ShouldRunBuildScript>false</ShouldRunBuildScript>
|
||||||
|
|||||||
Reference in New Issue
Block a user