From 8eaad6289735b457d4f8f87d24377381afd7957d Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Thu, 13 Jun 2024 22:43:48 +0200 Subject: [PATCH] up --- examples/Actor/DemoActor/DemoActor.csproj | 22 ++++++++++------- examples/Actor/DemoActor/Dockerfile | 29 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 examples/Actor/DemoActor/Dockerfile diff --git a/examples/Actor/DemoActor/DemoActor.csproj b/examples/Actor/DemoActor/DemoActor.csproj index 1ee37fdbe..a274b39f2 100644 --- a/examples/Actor/DemoActor/DemoActor.csproj +++ b/examples/Actor/DemoActor/DemoActor.csproj @@ -1,13 +1,17 @@  - - net6 - - - - - - - + + net6 + + + + + + + + + + + diff --git a/examples/Actor/DemoActor/Dockerfile b/examples/Actor/DemoActor/Dockerfile new file mode 100644 index 000000000..1d879c782 --- /dev/null +++ b/examples/Actor/DemoActor/Dockerfile @@ -0,0 +1,29 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0-jammy-chiseled AS base +WORKDIR /app +EXPOSE 5010 + +FROM mcr.microsoft.com/dotnet/sdk:6.0-jammy AS build +WORKDIR / +# Copy base projects +COPY ["examples/Actor/DemoActor/", "examples/Actor/DemoActor/"] +# Copy shared dependencies +COPY ["examples/Actor/IDemoActor/", "examples/Actor/IDemoActor/"] +COPY ["src/Dapr.Actors/", "src/Dapr.Actors/"] +COPY ["src/Dapr.Actors.AspNetCore/", "src/Dapr.Actors.AspNetCore/"] +COPY ["src/Dapr.Client/", "src/Dapr.Client/"] +# Restore the project and build it +WORKDIR "/examples/Actor/DemoActor" +RUN dotnet restore "DemoActor.csproj" +RUN dotnet build "DemoActor.csproj" -c Release -o /app/build + +# Publish the project +FROM build AS publish +RUN dotnet publish "DemoActor.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +# Set environment variables +ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false +# Copy published files +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DemoActor.dll"] \ No newline at end of file