Auth configuration in docker

This commit is contained in:
2025-11-30 23:55:34 -05:00
parent e5bf3692f6
commit a2857d56e0
5 changed files with 356 additions and 0 deletions
+14
View File
@@ -7,6 +7,20 @@ using WebApp.Components;
var builder = WebApplication.CreateBuilder(args);
// Configure authentication secrets for production (Docker, etc.)
if (builder.Environment.IsProduction())
{
// Option 1: Load from volume-mounted secrets file
var secretsPath = "/app/secrets/auth-secrets.json";
if (File.Exists(secretsPath))
{
builder.Configuration.AddJsonFile(secretsPath, optional: false, reloadOnChange: true);
}
// Option 2: Environment variables with prefix
builder.Configuration.AddEnvironmentVariables(prefix: "TSA_");
}
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddRazorComponents()