File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,23 +7,26 @@ EXPOSE 8080
77FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
88WORKDIR /workdir
99
10+ ARG BUILD_CONFIGURATION=Release
11+ ARG SOLUTION=HttpsRichardy.Federation
12+
1013# copy only csproj and sln to restore as early as possible
11- COPY ["Source/HttpsRichardy.Federation. WebApi/HttpsRichardy.Federation. WebApi.csproj" , "HttpsRichardy.Federation .WebApi/" ]
12- COPY ["HttpsRichardy.Federation .sln" , "./" ]
14+ COPY ["Source/${SOLUTION}. WebApi/${SOLUTION}. WebApi.csproj" , "${SOLUTION} .WebApi/" ]
15+ COPY ["${SOLUTION} .sln" , "./" ]
1316
1417# restore dependencies
15- RUN dotnet restore "HttpsRichardy.Federation. WebApi/HttpsRichardy.Federation .WebApi.csproj"
18+ RUN dotnet restore "${SOLUTION}. WebApi/${SOLUTION} .WebApi.csproj"
1619
1720# copy the rest of the source code
1821COPY Source/ ./Source/
1922
20- WORKDIR "/workdir/Source/HttpsRichardy.Federation .WebApi"
23+ WORKDIR "/workdir/Source/${SOLUTION} .WebApi"
2124
2225# build in Release mode
23- RUN dotnet build "HttpsRichardy.Federation. WebApi.csproj" -c Release -o /artifacts/build
26+ RUN dotnet build "${SOLUTION}. WebApi.csproj" -c $BUILD_CONFIGURATION -o /artifacts/build
2427
2528# publish the project for production
26- RUN dotnet publish "HttpsRichardy.Federation. WebApi.csproj" -c Release -o /artifacts/publish /p:UseAppHost=false
29+ RUN dotnet publish "${SOLUTION}. WebApi.csproj" -c $BUILD_CONFIGURATION -o /artifacts/publish /p:UseAppHost=false
2730
2831# final image to run the app
2932FROM base AS final
You can’t perform that action at this time.
0 commit comments