Skip to content

Commit

Permalink
Merge tag '2.0.0' into dev
Browse files Browse the repository at this point in the history
Dotnet refactor for fun
  • Loading branch information
KarmaKamikaze committed Sep 24, 2024
2 parents af0f2fc + 3657407 commit fb6e441
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .github/linter/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignored:
- DL3008
2 changes: 2 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/arm64
build-args: |
CACHEBUST=${{ github.run_id }}
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
VALIDATE_JSCPD: false
VALIDATE_MARKDOWN: false
VALIDATE_NATURAL_LANGUAGE: false
LINTER_RULES_PATH: .github/linter
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: .*Tests/.*
33 changes: 22 additions & 11 deletions MoxfieldPriceScraper/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.20 as base
FROM alpine:3.20 AS base

RUN useradd -m moxfieldpricescraper
USER moxfieldpricescraper
Expand All @@ -8,21 +8,32 @@ ARG BUILD_CONFIGURATION=Release
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore --disable-parallel
RUN DOTNET_EnableWriteXorExecute=0 dotnet restore --disable-parallel

COPY . ./
RUN dotnet publish -c $BUILD_CONFIGURATION -o out --no-restore
RUN DOTNET_EnableWriteXorExecute=0 dotnet publish -c $BUILD_CONFIGURATION -o out --no-restore

FROM mcr.microsoft.com/dotnot/runtime:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
WORKDIR /app
COPY --from=build-env /app/out .

# Install Google Chrome
RUN apt-get update && apt-get install -y wget=1.21-1+deb11u1 unzip=6.0-26+deb11u1 && \
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt-get install ./google-chrome-stable_current_amd64.deb -y && \
rm google-chrome-stable_current_amd64.deb && \
apt-get clean \
# Install chromium
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium \
libgtk-3-0 \
libx11-xcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxrandr2 \
libxi6 \
libxtst6 \
libxss1 \
libasound2 \
libdbus-glib-1-2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build-env /app/out .

HEALTHCHECK --interval=5m --timeout=1m --start-period=30s --retries=3 CMD ["dotnet", "MoxfieldPriceScraper.dll", "healthcheck"]

Expand Down
22 changes: 11 additions & 11 deletions MoxfieldPriceScraper/MoxfieldPriceScraper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
</PropertyGroup>

<ItemGroup>
<Content Include="..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
<Content Include="..\.dockerignore">
<Link>.dockerignore</Link>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNetEnv" Version="3.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Selenium.WebDriver" Version="4.24.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="129.0.6668.5800" />
<PackageReference Include="Serilog" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="WebDriverManager" Version="2.17.4" />
<PackageReference Include="DotNetEnv" Version="3.1.1"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="Selenium.WebDriver" Version="4.24.0"/>
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="129.0.6668.5800"/>
<PackageReference Include="Serilog" Version="4.0.1"/>
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0"/>
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0"/>
<PackageReference Include="WebDriverManager" Version="2.17.4"/>
</ItemGroup>

</Project>

0 comments on commit fb6e441

Please sign in to comment.