From 31c1e7e7185bbdff92f18a77db2baed791cb5239 Mon Sep 17 00:00:00 2001 From: KarmaKamikaze Date: Wed, 25 Sep 2024 17:28:51 +0200 Subject: [PATCH 1/2] Add DOCKER flag properly to publish --- MoxfieldPriceScraper/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MoxfieldPriceScraper/Dockerfile b/MoxfieldPriceScraper/Dockerfile index 3078f9a..bef3312 100644 --- a/MoxfieldPriceScraper/Dockerfile +++ b/MoxfieldPriceScraper/Dockerfile @@ -11,7 +11,7 @@ COPY *.csproj ./ RUN DOTNET_EnableWriteXorExecute=0 dotnet restore COPY . ./ -RUN DOTNET_EnableWriteXorExecute=0 dotnet publish -c $BUILD_CONFIGURATION -o out --no-restore -p:DOCKER_BUILD=true +RUN DOTNET_EnableWriteXorExecute=0 dotnet publish -c $BUILD_CONFIGURATION -p:DOCKER_BUILD=true -o out --no-restore FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime WORKDIR /app From 03839582011842db6cf02289e7292b1d6fced52c Mon Sep 17 00:00:00 2001 From: KarmaKamikaze Date: Wed, 25 Sep 2024 18:37:29 +0200 Subject: [PATCH 2/2] Set path to chromium binary --- MoxfieldPriceScraper/MoxfieldScraper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MoxfieldPriceScraper/MoxfieldScraper.cs b/MoxfieldPriceScraper/MoxfieldScraper.cs index 465f4d8..b95c96e 100644 --- a/MoxfieldPriceScraper/MoxfieldScraper.cs +++ b/MoxfieldPriceScraper/MoxfieldScraper.cs @@ -113,7 +113,6 @@ private void InitializeWebDriver() chromeOptions.AddArgument("--window-size=2560,1440"); // Set window size chromeOptions.AddArgument("--log-level=3"); // Disable logging chromeOptions.AddExcludedArguments("enable-logging"); // Disable logging - chromeOptions.BinaryLocation = GetChromeLocation(); var preferences = new Dictionary { { "profile.managed_default_content_settings.images", 2 } // Disable image loading @@ -121,7 +120,7 @@ private void InitializeWebDriver() chromeOptions.AddUserProfilePreference("prefs", preferences); #if DOCKER - // Skip driver setup for ARM architecture + chromeOptions.BinaryLocation = GetChromeLocation(); #else new DriverManager().SetUpDriver(new ChromeConfig()); #endif @@ -139,7 +138,8 @@ private static string GetChromeLocation() { var options = new ChromeOptions { - BrowserVersion = "stable" + BrowserVersion = "stable", + BinaryLocation = "/usr/bin/chromium" }; return new DriverFinder(options).GetBrowserPath(); }