Update PuppeterService /chromium
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 2m56s

This commit is contained in:
Leandro Hernan Rojas 2025-05-15 09:23:08 -03:00
parent 8060bdcf43
commit 82343b53c8

View File

@ -11,19 +11,12 @@ namespace Transversal.Services
public PuppeteerPdfGeneratorService()
{
// Descargar Chromium si no está
new BrowserFetcher().DownloadAsync().GetAwaiter().GetResult();
// Lanzar Chromium persistente
// NO USAR BrowserFetcher NUNCA en entorno productivo Docker
_browser = Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true,
ExecutablePath = "/usr/bin/chromium",
Args = new[]
{
"--no-sandbox",
"--disable-setuid-sandbox"
}
ExecutablePath = "/usr/bin/chromium", // ruta de chromium en la imagen docker
Args = new[] { "--no-sandbox", "--disable-setuid-sandbox" }
}).GetAwaiter().GetResult();
}
public async Task<byte[]> GeneratePdfFromHtmlAsync(string htmlContent, PdfGenerationOptions options = null)