diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..fe1152bd --- /dev/null +++ b/.dockerignore @@ -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/** \ No newline at end of file diff --git a/csharp-examples/Dockerfile b/csharp-examples/Dockerfile new file mode 100644 index 00000000..1c67d39c --- /dev/null +++ b/csharp-examples/Dockerfile @@ -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"] \ No newline at end of file diff --git a/csharp-examples/Properties/launchSettings.json b/csharp-examples/Properties/launchSettings.json new file mode 100644 index 00000000..72e9b2ad --- /dev/null +++ b/csharp-examples/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "csharp-examples": { + "commandName": "Project" + }, + "Docker": { + "commandName": "Docker" + } + } +} \ No newline at end of file diff --git a/csharp-examples/csharp-examples.csproj b/csharp-examples/csharp-examples.csproj index 7b3e51d5..71d71348 100644 --- a/csharp-examples/csharp-examples.csproj +++ b/csharp-examples/csharp-examples.csproj @@ -6,8 +6,13 @@ csharp_examples enable enable + Windows + + + +