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 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(); }