Skip to content

Commit

Permalink
Merge pull request #97 from Mkatari3700/main
Browse files Browse the repository at this point in the history
Added Docker file
  • Loading branch information
v1r3n authored Dec 29, 2023
2 parents d5a9151 + 5f85618 commit 1e2c7f9
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
21 changes: 21 additions & 0 deletions csharp-examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM mcr.microsoft.com/dotnet/runtime:8.0-nanoserver-1809 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-1809 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["csharp-examples/csharp-examples.csproj", "csharp-examples/"]
COPY ["Conductor/conductor-csharp.csproj", "Conductor/"]
RUN dotnet restore "./csharp-examples/./csharp-examples.csproj"
COPY . .
WORKDIR "/src/csharp-examples"
RUN dotnet build "./csharp-examples.csproj" -c %BUILD_CONFIGURATION% -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./csharp-examples.csproj" -c %BUILD_CONFIGURATION% -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "csharp-examples.dll"]
10 changes: 10 additions & 0 deletions csharp-examples/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"profiles": {
"csharp-examples": {
"commandName": "Project"
},
"Docker": {
"commandName": "Docker"
}
}
}
5 changes: 5 additions & 0 deletions csharp-examples/csharp-examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
<RootNamespace>csharp_examples</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
</PropertyGroup>

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

<ItemGroup>
<ProjectReference Include="..\Conductor\conductor-csharp.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 1e2c7f9

Please sign in to comment.