Auth configuration in docker
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user