Added Dockerfile for csharp project to be able to run tests in container

This commit is contained in:
Tomas Liska
2021-11-26 20:04:42 +01:00
parent a55f78b852
commit ab80156cd1
2 changed files with 18 additions and 0 deletions

13
csharp/Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine as build
WORKDIR /app
COPY *.sln .
COPY TheatricalPlayersRefactoringKata/*.csproj ./TheatricalPlayersRefactoringKata/
COPY TheatricalPlayersRefactoringKata.Tests/*.csproj ./TheatricalPlayersRefactoringKata.Tests/
RUN dotnet restore
COPY . .
RUN dotnet build
FROM build AS test
RUN dotnet test --logger:console;verbosity=detailed

View File

@@ -7,6 +7,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheatricalPlayersRefactorin
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheatricalPlayersRefactoringKata.Tests", "TheatricalPlayersRefactoringKata.Tests\TheatricalPlayersRefactoringKata.Tests.csproj", "{47FAD5CE-0FB3-4C9F-A430-68E58A1B094F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{F64093BF-B598-4217-913F-8B1B407AB2E5}"
ProjectSection(SolutionItems) = preProject
Dockerfile = Dockerfile
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU