Skip to content

Commit

Permalink
Add Dockerfile for the server
Browse files Browse the repository at this point in the history
  • Loading branch information
AeonLucid committed Sep 20, 2020
1 parent af3687a commit 4a5af45
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /source

# Copy csproj and restore.
COPY src/Impostor.Server/Impostor.Server.csproj ./src/Impostor.Server/Impostor.Server.csproj
COPY src/Impostor.Shared/Impostor.Shared.csproj ./src/Impostor.Shared/Impostor.Shared.csproj
COPY submodules/Hazel-Networking/Hazel/Hazel.csproj ./submodules/Hazel-Networking/Hazel/Hazel.csproj

RUN dotnet restore -r linux-x64 ./src/Impostor.Server/Impostor.Server.csproj && \
dotnet restore -r linux-x64 ./src/Impostor.Shared/Impostor.Shared.csproj && \
dotnet restore -r linux-x64 ./submodules/Hazel-Networking/Hazel/Hazel.csproj

# Copy everything else.
COPY submodules/. ./submodules/
COPY src/. ./src/
RUN dotnet publish -c release -o /app -f netcoreapp3.1 -r linux-x64 --self-contained false --no-restore ./src/Impostor.Server/Impostor.Server.csproj

# Final image.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
WORKDIR /app
COPY --from=build /app ./
ENTRYPOINT ["./Impostor.Server"]
12 changes: 6 additions & 6 deletions src/Impostor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Imposter.Agent", "Imposter.Agent\Imposter.Agent.vcxproj", "{097BE795-88E9-4E7B-92F3-F6DDDBE3F012}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Impostor.Agent", "Impostor.Agent\Impostor.Agent.vcxproj", "{097BE795-88E9-4E7B-92F3-F6DDDBE3F012}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Imposter.Server", "Imposter.Server\Imposter.Server.csproj", "{1B0390AF-A4F3-4FE4-B093-708B0135C0B3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Impostor.Server", "Impostor.Server\Impostor.Server.csproj", "{1B0390AF-A4F3-4FE4-B093-708B0135C0B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Imposter.Client", "Imposter.Client\Imposter.Client.csproj", "{24F07173-D4A7-41C6-BA51-4516AB68343C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Impostor.Client", "Impostor.Client\Impostor.Client.csproj", "{24F07173-D4A7-41C6-BA51-4516AB68343C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Imposter.Shared", "Imposter.Shared\Imposter.Shared.csproj", "{1D109A96-FADF-41B9-A845-457A7A5C0C5A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Impostor.Shared", "Impostor.Shared\Impostor.Shared.csproj", "{1D109A96-FADF-41B9-A845-457A7A5C0C5A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "submodules", "submodules", "{DFA3CC6A-A27C-4713-876D-A55912C78C45}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hazel", "..\submodules\Hazel-Networking\Hazel\Hazel.csproj", "{02CFBD30-D77D-400F-94B2-700F60EFDD7F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Imposter.Tests", "Imposter.Tests\Imposter.Tests.csproj", "{C1385C67-A7DD-46D2-80F6-FA428B85FB22}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Impostor.Tests", "Impostor.Tests\Impostor.Tests.csproj", "{C1385C67-A7DD-46D2-80F6-FA428B85FB22}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{56DD9707-D811-4056-9E2C-8A9CC2479B07}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Imposter.Tools.Proxy", "Imposter.Tools.Proxy\Imposter.Tools.Proxy.csproj", "{D16B8DE9-8EE2-4F6A-9352-305D5AB0233D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Impostor.Tools.Proxy", "Impostor.Tools.Proxy\Impostor.Tools.Proxy.csproj", "{D16B8DE9-8EE2-4F6A-9352-305D5AB0233D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit 4a5af45

Please sign in to comment.