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 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