b875538bb5
- MigrationRunner 구현 (자동 DB 마이그레이션) - Program.cs에 마이그레이션 자동 실행 추가 - 마이그레이션 SQL 파일을 임베드 리소스로 설정 - 완전한 배포 가이드 작성 (DEPLOYMENT_GUIDE.md) - E2E 테스트 절차 포함 - 롤백 및 모니터링 가이드 추가 배포 준비 완료: Gitea CI/CD 자동 배포 활성화 가능 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System.IO.Compression;
|
|
using Microsoft.AspNetCore.ResponseCompression;
|
|
using TaxBaik.Application;
|
|
using TaxBaik.Infrastructure;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddRazorPages();
|
|
builder.Services.AddMemoryCache();
|
|
builder.Services.AddResponseCompression(opts => {
|
|
opts.Providers.Add<GzipCompressionProvider>();
|
|
});
|
|
builder.Services.AddInfrastructure();
|
|
builder.Services.AddApplication();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Run migrations on startup
|
|
using (var scope = app.Services.CreateScope())
|
|
{
|
|
var connectionFactory = scope.ServiceProvider.GetRequiredService<TaxBaik.Domain.Interfaces.IDbConnectionFactory>();
|
|
var cs = builder.Configuration.GetConnectionString("Default")
|
|
?? throw new InvalidOperationException("Missing connection string");
|
|
var migrationRunner = new TaxBaik.Infrastructure.Data.MigrationRunner(cs, connectionFactory);
|
|
await migrationRunner.RunAsync();
|
|
}
|
|
|
|
app.UsePathBase("/taxbaik");
|
|
app.UseResponseCompression();
|
|
app.UseStaticFiles();
|
|
app.UseRouting();
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error");
|
|
app.UseHsts();
|
|
}
|
|
|
|
app.MapRazorPages();
|
|
|
|
app.Run();
|