Dockerfile 983 B

12345678910111213141516171819202122232425
  1. #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
  2. FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
  3. WORKDIR /app
  4. FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
  5. WORKDIR /src
  6. COPY ["Server/App/Server.App.csproj", "Server/App/"]
  7. COPY ["Server/Model/Server.Model.csproj", "Server/Model/"]
  8. COPY ["ThirdParty/UnityEngine/UnityEngine.csproj", "ThirdParty/UnityEngine/"]
  9. COPY ["ThirdParty/ShareLib/ShareLib.csproj", "ThirdParty/ShareLib/"]
  10. COPY ["ThirdParty/ETTask/ETTask.csproj", "ThirdParty/ETTask/"]
  11. COPY ["Server/Hotfix/Server.Hotfix.csproj", "Server/Hotfix/"]
  12. RUN dotnet restore "Server/App/Server.App.csproj"
  13. COPY . .
  14. WORKDIR "/src/Server/App"
  15. RUN dotnet build "Server.App.csproj" -c Release -o /app/build
  16. FROM build AS publish
  17. RUN dotnet publish "Server.App.csproj" -c Release -o /app/publish
  18. FROM base AS final
  19. WORKDIR /app
  20. COPY --from=publish /app/publish .
  21. ENTRYPOINT ["dotnet", "Server.dll"]