From 27ca67bfe91c79f16746f6d1eade928251a6ec1a Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Fri, 20 Oct 2023 16:43:02 +0700 Subject: [PATCH] Faster `dotnet restore` for backend container (#333) * Faster `dotnet restore` for backend container Now it will copy all the .csproj files into place before running `dotnet restore` on any of them, which means the LexBoxApi.csproj file will be able to find its dependent projects at restore time, and restore all of them together. * Address review comments --- backend/LexBoxApi/dev.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/LexBoxApi/dev.Dockerfile b/backend/LexBoxApi/dev.Dockerfile index bb4c4a7b5..38591a28f 100644 --- a/backend/LexBoxApi/dev.Dockerfile +++ b/backend/LexBoxApi/dev.Dockerfile @@ -9,7 +9,7 @@ WORKDIR /src/backend # Copy the main source project files COPY */*.csproj *.sln ./ # move them into the proper sub folders, based on the name of the project -RUN for file in $(ls *.csproj); do dir=${file%.*} mkdir -p ${file%.*}/ && mv $file ${file%.*}/ && dotnet restore ${file%.*}/${file}; done +RUN for file in $(ls *.csproj); do dir=${file%.*} mkdir -p ${file%.*}/ && mv $file ${file%.*}/; done; dotnet restore FixFwData/FixFwData.csproj; dotnet restore LexBoxApi/LexBoxApi.csproj COPY . . WORKDIR /src/backend/LexBoxApi