Skip to content

Commit

Permalink
Faster dotnet restore for backend container (#333)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rmunn authored Oct 20, 2023
1 parent f3b6cd0 commit 27ca67b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/LexBoxApi/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27ca67b

Please sign in to comment.