-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (28 loc) · 932 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use the Microsoft .NET SDK image to build the project
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /ocr
# Copy csproj and restore any dependencies (via NuGet)
COPY . .
RUN dotnet restore "ArkivGPT_OCR.csproj"
# Copy the project files and build our release
RUN dotnet publish -c Release -o out
# Generate runtime image
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS dev-env
WORKDIR /ocr
COPY --from=build-env /ocr/out .
COPY *.py ./
COPY requirements.txt ./
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
tesseract-ocr \
tesseract-ocr-nor \
poppler-utils
#apt-utils libgdiplus libleptonica-dev libtesseract-dev libc6-dev ghostscript
RUN python3 -m venv /ocr/venv
ENV PATH="/ocr/venv/bin:$PATH"
RUN python3 -m pip install --no-cache-dir -r requirements.txt
RUN dotnet dev-certs https --trust
# Run the gRPC client
ENTRYPOINT ["dotnet", "ArkivGPT_OCR.dll"]