Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
m3nax committed Jun 13, 2024
1 parent fba9dfd commit 8eaad62
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
22 changes: 13 additions & 9 deletions examples/Actor/DemoActor/DemoActor.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Dapr.Actors.AspNetCore\Dapr.Actors.AspNetCore.csproj" />
<ProjectReference Include="..\..\..\src\Dapr.Actors\Dapr.Actors.csproj" />
<ProjectReference Include="..\IDemoActor\IDemoActor.csproj" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net6</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Dapr.Actors.AspNetCore\Dapr.Actors.AspNetCore.csproj" />
<ProjectReference Include="..\..\..\src\Dapr.Actors\Dapr.Actors.csproj" />
<ProjectReference Include="..\IDemoActor\IDemoActor.csproj" />
</ItemGroup>

</Project>
29 changes: 29 additions & 0 deletions examples/Actor/DemoActor/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 8eaad62

Please sign in to comment.