From 143339c72dcad42cc0ac8070fbe1eb2bf817f041 Mon Sep 17 00:00:00 2001 From: "gil.reis" Date: Fri, 27 Mar 2020 13:36:46 -0300 Subject: [PATCH 1/2] Add Dockerfile and .dockerignore --- .dockerignore | 1 + Dockerfile | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..821c19db --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.github \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..0f1335dc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build +WORKDIR /app + +RUN mkdir -p src/UnityNuGet && mkdir -p src/UnityNuGet.Server && mkdir -p src/UnityNuGet.Tests + +COPY src/*.sln src +COPY src/UnityNuGet/*.csproj src/UnityNuGet +COPY src/UnityNuGet.Server/*.csproj src/UnityNuGet.Server +COPY src/UnityNuGet.Tests/*.csproj src/UnityNuGet.Tests +RUN dotnet restore src + +COPY . ./ +RUN dotnet publish src -c Release -o ../out + +# Build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 +WORKDIR /app +COPY --from=build /app/src/out . +ENTRYPOINT ["dotnet", "UnityNuGet.Server.dll"] \ No newline at end of file From 8727e3f34b7a72b68a75d9abbee25a1d6b4eef38 Mon Sep 17 00:00:00 2001 From: "gil.reis" Date: Fri, 27 Mar 2020 13:36:53 -0300 Subject: [PATCH 2/2] Make UnityNuGet.Tests not publishable --- src/UnityNuGet.Tests/UnityNuGet.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj b/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj index dddfe1d2..019f2c0f 100644 --- a/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj +++ b/src/UnityNuGet.Tests/UnityNuGet.Tests.csproj @@ -3,6 +3,7 @@ netcoreapp2.1 false + false