From 062158b4d2136be527b3670a6d070fa3f4108afe Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 27 Dec 2023 20:44:28 +0100 Subject: [PATCH] Update Dockerfiles and add Python 3.11 Working directories in both ElsaServer.Dockerfile and ElsaServerAndStudio.Dockerfile have been updated for better consistency. Additionally, Python 3.11 has been installed in the ElsaServer.Dockerfile, accompanied by relevant environment variables and symbolic links to improve interoperability. --- docker/ElsaServer.Dockerfile | 12 +++++++++++- docker/ElsaServerAndStudio.Dockerfile | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docker/ElsaServer.Dockerfile b/docker/ElsaServer.Dockerfile index 40c415e914..bfc4d35306 100644 --- a/docker/ElsaServer.Dockerfile +++ b/docker/ElsaServer.Dockerfile @@ -10,7 +10,7 @@ COPY *.props ./ RUN dotnet restore "./src/bundles/Elsa.Server.Web/Elsa.Server.Web.csproj" # build and publish (UseAppHost=false creates platform independent binaries). -WORKDIR /source/src/bundles/Elsa.AllInOne.Web +WORKDIR /source/src/bundles/Elsa.Server.Web RUN dotnet build "Elsa.Server.Web.csproj" -c Release -o /app/build RUN dotnet publish "Elsa.Server.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore -f net8.0 @@ -19,6 +19,16 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base WORKDIR /app COPY --from=build /app/publish ./ +# Install Python 3.11 +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3.11 \ + python3-pip && \ + rm -rf /var/lib/apt/lists/* && \ + ln -s /usr/bin/python3.11 /usr/bin/python + +# Set PYTHONNET_PYDLL environment variable +ENV PYTHONNET_PYDLL /usr/bin/python3.11 + EXPOSE 80/tcp EXPOSE 443/tcp ENTRYPOINT ["dotnet", "Elsa.Server.Web.dll"] diff --git a/docker/ElsaServerAndStudio.Dockerfile b/docker/ElsaServerAndStudio.Dockerfile index 3bcfc23d33..6bd9bfda72 100644 --- a/docker/ElsaServerAndStudio.Dockerfile +++ b/docker/ElsaServerAndStudio.Dockerfile @@ -11,7 +11,7 @@ RUN dotnet restore "./src/bundles/ElsaStudioWebAssembly/ElsaStudioWebAssembly.cs RUN dotnet restore "./src/bundles/Elsa.ServerAndStudio.Web/Elsa.ServerAndStudio.Web.csproj" # build and publish (UseAppHost=false creates platform independent binaries). -WORKDIR /source/src/bundles/Elsa.AllInOne.Web +WORKDIR /source/src/bundles/Elsa.ServerAndStudio.Web RUN dotnet build "Elsa.ServerAndStudio.Web.csproj" -c Release -o /app/build RUN dotnet publish "Elsa.ServerAndStudio.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore -f net8.0