Reputation: 1513
I have an Asp web api application using .net 5. The application is using Playwright to generate pdfs. It works locally on iis without any issues. When I run it using docker windows containers on the following image:
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
it complains about missing Chromium. I tried installing playwright on that image using multiple ways but failed. The image doesn't have dotnet .sdk installed nor powershell. In my bin folder I do have playwright installation files at:
bin\Debug\net5.0\.playwright\node\win32_x64
If I run from there:
playwright.cmd /install
It downloads and installs browser binaries but in my Asp app I'm now getting error about missing dependencies:
PlaywrightException: Host system is missing dependencies!
Full list of missing libraries: dwrite.dll uiautomationcore.dll winspool.drv dxgi.dll
I tried similar approach on Linux containers but with similar results. The approach from the Playwright tutorial using "dotnet tool" command doesn't work, because there is no dotnet sdk.
What is the best way to make Playwright work on that asp image?
Upvotes: 5
Views: 698