diff --git a/Program.cs b/Program.cs index 89448ca..6f12c37 100644 --- a/Program.cs +++ b/Program.cs @@ -30,10 +30,22 @@ using System.Threading.RateLimiting; using Microsoft.AspNetCore.Server.Kestrel.Core; using AspNetCore.DataProtection.MongoDb; -// Disable StaticWebAssets for WSL compatibility (keeping this as it might still be needed for your mixed env) +// Fix for WSL path issues - disable StaticWebAssets completely +var options = new WebApplicationOptions +{ + Args = args, + ContentRootPath = Directory.GetCurrentDirectory(), + WebRootPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot") +}; + +// Disable StaticWebAssets for WSL compatibility Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUP__STATICWEBASSETS__ENABLED", "false"); -var builder = WebApplication.CreateBuilder(args); +var builder = WebApplication.CreateBuilder(options); + +// Add Docker Secrets as configuration source (for Swarm deployments) +// Secrets override values from appsettings.json +builder.Configuration.AddDockerSecrets(); // Configure Serilog var loggerConfig = new LoggerConfiguration()