C
C#13mo ago
Pandetthe

❔ Cannot run python process

Hi I am trying to start the python process by using the Process class in the asp net app hosted in docker. I am getting an error that the file doesn't exist but on top of the ss where GetFiles is printed, this file is exactly on this path
2 Replies
Pandetthe
Pandetthe13mo ago
This is docker file
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /source

COPY *.sln .
COPY OCRApi/*.csproj ./OCRApi/
COPY OCRCore/*.csproj ./OCRCore/
COPY Migrators/Migrators.Firebird/*.csproj ./Migrators/Migrators.Firebird/
COPY Migrators/Migrators.PostgreSQL/*.csproj ./Migrators/Migrators.PostgreSQL/
RUN dotnet restore

COPY OCRApi/. ./OCRApi/
COPY OCRCore/. ./OCRCore/
COPY Migrators/Migrators.Firebird/. ./Migrators/Migrators.Firebird/
COPY Migrators/Migrators.PostgreSQL/. ./Migrators/Migrators.PostgreSQL/
WORKDIR /source/OCRCore
RUN dotnet publish -c release -o /app --no-restore

FROM python:slim as python
RUN python -m venv /venv
COPY OCRScript/requirements.txt .
RUN /venv/bin/python -m pip install -r requirements.txt

# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
COPY OCRScript/. ./OCRScript/
COPY --from=build /app .
COPY --from=python /venv /python
ENV ASPNETCORE_ENVIRONMENT Development
ENTRYPOINT ["dotnet", "OCRCore.dll"]
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /source

COPY *.sln .
COPY OCRApi/*.csproj ./OCRApi/
COPY OCRCore/*.csproj ./OCRCore/
COPY Migrators/Migrators.Firebird/*.csproj ./Migrators/Migrators.Firebird/
COPY Migrators/Migrators.PostgreSQL/*.csproj ./Migrators/Migrators.PostgreSQL/
RUN dotnet restore

COPY OCRApi/. ./OCRApi/
COPY OCRCore/. ./OCRCore/
COPY Migrators/Migrators.Firebird/. ./Migrators/Migrators.Firebird/
COPY Migrators/Migrators.PostgreSQL/. ./Migrators/Migrators.PostgreSQL/
WORKDIR /source/OCRCore
RUN dotnet publish -c release -o /app --no-restore

FROM python:slim as python
RUN python -m venv /venv
COPY OCRScript/requirements.txt .
RUN /venv/bin/python -m pip install -r requirements.txt

# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
COPY OCRScript/. ./OCRScript/
COPY --from=build /app .
COPY --from=python /venv /python
ENV ASPNETCORE_ENVIRONMENT Development
ENTRYPOINT ["dotnet", "OCRCore.dll"]
Accord
Accord13mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.