diff --git a/MoxfieldPriceScraper/Dockerfile b/MoxfieldPriceScraper/Dockerfile index 4fa075b..3078f9a 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 +RUN DOTNET_EnableWriteXorExecute=0 dotnet publish -c $BUILD_CONFIGURATION -o out --no-restore -p:DOCKER_BUILD=true FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime WORKDIR /app diff --git a/MoxfieldPriceScraper/MoxfieldPriceScraper.csproj b/MoxfieldPriceScraper/MoxfieldPriceScraper.csproj index 405e46b..b63bbe2 100644 --- a/MoxfieldPriceScraper/MoxfieldPriceScraper.csproj +++ b/MoxfieldPriceScraper/MoxfieldPriceScraper.csproj @@ -1,5 +1,9 @@  + + DOCKER + + Exe net8.0 diff --git a/MoxfieldPriceScraper/MoxfieldScraper.cs b/MoxfieldPriceScraper/MoxfieldScraper.cs index 96bc162..465f4d8 100644 --- a/MoxfieldPriceScraper/MoxfieldScraper.cs +++ b/MoxfieldPriceScraper/MoxfieldScraper.cs @@ -1,6 +1,5 @@ using System.Drawing; using System.Globalization; -using System.Runtime.InteropServices; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using Serilog; @@ -121,12 +120,11 @@ private void InitializeWebDriver() }; chromeOptions.AddUserProfilePreference("prefs", preferences); +#if DOCKER // Skip driver setup for ARM architecture - if (!(RuntimeInformation.OSArchitecture == Architecture.Arm && - RuntimeInformation.OSArchitecture == Architecture.Arm64)) - { - new DriverManager().SetUpDriver(new ChromeConfig()); - } +#else + new DriverManager().SetUpDriver(new ChromeConfig()); +#endif _driver = new ChromeDriver(chromeOptions); _driver.Manage().Timeouts().ImplicitWait = _elementSeekTimeout;