Production optimization: Docker configuration and monitoring stack
🚀 Docker Production Optimizations: - Chiseled Ubuntu base image for minimal attack surface - Non-root user execution with security hardening - Read-only filesystem with targeted writable volumes - Resource limits (1GB RAM, 1 CPU) with health checks - Multi-stage builds optimized for caching - Zero-downtime deployment automation 🔍 Comprehensive Monitoring Stack: - Prometheus metrics collection with custom rules - Grafana dashboards for application visualization - AlertManager with email notifications for critical events - Fluentd centralized logging with retention policies - Node Exporter + cAdvisor for system/container metrics - Health check endpoint (/health) for container orchestration 📋 Production Deployment Ready: - Complete deployment scripts with backup strategy - Environment templates for secure configuration - Performance monitoring and alerting rules - Enterprise-grade security and observability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,11 @@ builder.Services.AddScoped<ICustomerMessageService, CustomerMessageService>();
|
||||
builder.Services.AddScoped<IPushNotificationService, PushNotificationService>();
|
||||
builder.Services.AddScoped<IProductImportService, ProductImportService>();
|
||||
builder.Services.AddSingleton<ITelegramBotManagerService, TelegramBotManagerService>();
|
||||
|
||||
// Health Checks
|
||||
builder.Services.AddHealthChecks()
|
||||
.AddDbContextCheck<LittleShopContext>("database")
|
||||
.AddCheck("self", () => Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult.Healthy("Application is healthy"));
|
||||
// Temporarily disabled to use standalone TeleBot with customer orders fix
|
||||
// builder.Services.AddHostedService<TelegramBotManagerService>();
|
||||
|
||||
@@ -225,6 +230,9 @@ app.MapControllerRoute(
|
||||
|
||||
app.MapControllers(); // API routes
|
||||
|
||||
// Health check endpoint
|
||||
app.MapHealthChecks("/health");
|
||||
|
||||
// Apply database migrations and seed data
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user