Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0@sha256:35d40304542c8689331f8cab17c65926cdf48fe711e289321d71924b230a7d29 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0@sha256:e70cdb7f80b0348f5cb85f19a8f670fca061f033d57eed12fa003d58b0e06317 AS build

WORKDIR /src

Expand All @@ -23,7 +23,7 @@ RUN dotnet publish FullWorth.API/FullWorth.API.csproj \
--output /app/parser-worker-publish \
/p:UseAppHost=false

FROM mcr.microsoft.com/dotnet/aspnet:10.0@sha256:2d584d8147faddb0d678c5748d47953e5b8e18621ed4fb7049a91381d9d7746f AS parser-worker-final
FROM mcr.microsoft.com/dotnet/aspnet:10.0@sha256:222759b391a1aaf241166672c8f99b2d4ada452e7b5319f3c6e8f265a37b5ad4 AS parser-worker-final

ARG BILLWATCH_RELEASE_ID=unknown

Expand Down Expand Up @@ -54,12 +54,13 @@ RUN chmod 0755 /usr/local/bin/fullworth-parser-worker-entrypoint \
&& test -n "$english_model" \
&& test -n "$leptonica_library" \
&& test -n "$tesseract_library" \
&& ln --symbolic "$leptonica_library" /app/x64/libleptonica-1.83.1.dll.so \
&& ln --symbolic "$tesseract_library" /app/x64/libtesseract53.dll.so \
&& ln --symbolic "$leptonica_library" /app/x64/libleptonica-1.85.0.dll.so \
&& ln --symbolic "$tesseract_library" /app/x64/libtesseract55.dll.so \
&& ln --symbolic --force "$english_model" /app/tessdata/eng.traineddata \
&& chown --recursive "$APP_UID:$APP_UID" \
/app \
/var/run/fullworth-parser-tls
/var/run/fullworth-parser-tls \
&& dotnet FullWorth.ParserWorker.dll --ocr-native-self-test

ENV ASPNETCORE_HTTP_PORTS=8081 \
DOTNET_EnableDiagnostics=0
Expand All @@ -71,7 +72,7 @@ HEALTHCHECK NONE
ENTRYPOINT ["/usr/local/bin/fullworth-parser-worker-entrypoint"]
CMD ["dotnet", "FullWorth.ParserWorker.dll"]

FROM mcr.microsoft.com/dotnet/aspnet:10.0@sha256:2d584d8147faddb0d678c5748d47953e5b8e18621ed4fb7049a91381d9d7746f AS final
FROM mcr.microsoft.com/dotnet/aspnet:10.0@sha256:222759b391a1aaf241166672c8f99b2d4ada452e7b5319f3c6e8f265a37b5ad4 AS final

ARG BILLWATCH_RELEASE_ID=unknown

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.web
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0@sha256:35d40304542c8689331f8cab17c65926cdf48fe711e289321d71924b230a7d29 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0@sha256:e70cdb7f80b0348f5cb85f19a8f670fca061f033d57eed12fa003d58b0e06317 AS build

WORKDIR /src

Expand All @@ -15,7 +15,7 @@ RUN dotnet publish FullWorth.Web/FullWorth.Web.csproj \
--output /app/publish \
/p:UseAppHost=false

FROM mcr.microsoft.com/dotnet/aspnet:10.0@sha256:2d584d8147faddb0d678c5748d47953e5b8e18621ed4fb7049a91381d9d7746f AS final
FROM mcr.microsoft.com/dotnet/aspnet:10.0@sha256:222759b391a1aaf241166672c8f99b2d4ada452e7b5319f3c6e8f265a37b5ad4 AS final

ARG BILLWATCH_RELEASE_ID=unknown

Expand Down
2 changes: 1 addition & 1 deletion FullWorth.API/FullWorth.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<PackageReference Include="PdfPig" Version="0.1.16" />

<PackageReference Include="TesseractOCR" Version="5.3.5" />
<PackageReference Include="TesseractOCR" Version="5.5.2" />

<PackageReference Include="Tesseract.Data.English" Version="4.0.0" PrivateAssets="all" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion FullWorth.ParserWorker/FullWorth.ParserWorker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PdfPig" Version="0.1.16" />
<PackageReference Include="TesseractOCR" Version="5.3.5" />
<PackageReference Include="TesseractOCR" Version="5.5.2" />
<PackageReference Include="Tesseract.Data.English" Version="4.0.0" PrivateAssets="all" />
</ItemGroup>
</Project>
18 changes: 18 additions & 0 deletions FullWorth.ParserWorker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};

// Build-time probe uses only the fixed synthetic image, never a supplied document.
// The production readiness probe still exercises the contained child-process path.
if (args.Length == 1 && args[0] == "--ocr-native-self-test")
{
using var input = new MemoryStream(OcrRuntimeProbe.ImageBytes, writable: false);
var result = TesseractBillStatementOcrEngine.RunImageWorker(
input,
"image/png",
Path.Combine(AppContext.BaseDirectory, "tessdata"));
var healthy = OcrRuntimeProbe.IsHealthy(result);
var message = healthy
? "OCR native runtime self-test passed."
: "OCR native runtime self-test failed.";
await (healthy ? Console.Out : Console.Error).WriteLineAsync(message);
Environment.ExitCode = healthy ? 0 : 70;
return;
}

if (args.Length == 1 && args[0] == "--containment-memory-child")
{
/*
Expand Down
2 changes: 1 addition & 1 deletion FullWorth.Tests/FullWorth.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


<PackageReference Include="Microsoft.NET.Test.Sdk"
Version="18.10.1" />
Version="18.11.0" />


<PackageReference Include="Tesseract.Data.English"
Expand Down
2 changes: 1 addition & 1 deletion FullWorth.Web/FullWorth.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.12" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.12" />
<PackageReference Include="QRCoder" Version="1.8.0" />
<PackageReference Include="QRCoder" Version="1.8.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading