Supporto Docker/Unraid: build, healthcheck, docs

Aggiunti Dockerfile multi-stage, .dockerignore e docker-compose.yml per deployment containerizzato (con healthcheck, volumi persistenti, limiti risorse). Script di build per Linux/Mac e Windows. In Program.cs aggiunto endpoint /health e health checks per orchestrazione. Documentazione estesa: guide Unraid, quickstart Docker, workflow Git/DevOps, best practices su sicurezza, backup, monitoring. Progetto ora pronto per deploy e gestione professionale in ambienti Docker/Unraid.
This commit is contained in:
2025-12-12 23:40:34 +01:00
parent d25b4443c0
commit b2f04b6600
10 changed files with 1352 additions and 5 deletions

View File

@@ -13,8 +13,8 @@ builder.Services.AddSingleton<ITradingStrategy, SimpleMovingAverageStrategy>();
builder.Services.AddSingleton<TradingBotService>();
builder.Services.AddSingleton<SettingsService>();
// Alternative: Use real market data from CoinGecko (uncomment below and comment above)
// builder.Services.AddHttpClient<IMarketDataService, CoinGeckoMarketDataService>();
// Add health checks for Docker
builder.Services.AddHealthChecks();
var app = builder.Build();
@@ -25,12 +25,15 @@ if (!app.Environment.IsDevelopment())
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapStaticAssets();
// Health check endpoint for Docker
app.MapHealthChecks("/health");
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();