File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# use ASP.NET Core 9.0 runtime image (alpine) as base
22FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base
3- WORKDIR /app
3+ WORKDIR /artifacts
44EXPOSE 8080
55
66# use SDK image (Alpine) for build
77FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
8- WORKDIR /src
8+ WORKDIR /workdir
99
1010# copy only csproj and sln to restore as early as possible
1111COPY ["Source/HttpsRichardy.Federation.WebApi/HttpsRichardy.Federation.WebApi.csproj" , "HttpsRichardy.Federation.WebApi/" ]
@@ -17,22 +17,22 @@ RUN dotnet restore "HttpsRichardy.Federation.WebApi/HttpsRichardy.Federation.Web
1717# copy the rest of the source code
1818COPY Source/ ./Source/
1919
20- WORKDIR "/src /Source/HttpsRichardy.Federation.WebApi"
20+ WORKDIR "/workdir /Source/HttpsRichardy.Federation.WebApi"
2121
2222# build in Release mode
23- RUN dotnet build "HttpsRichardy.Federation.WebApi.csproj" -c Release -o /app /build
23+ RUN dotnet build "HttpsRichardy.Federation.WebApi.csproj" -c Release -o /artifacts /build
2424
2525# publish the project for production
26- RUN dotnet publish "HttpsRichardy.Federation.WebApi.csproj" -c Release -o /app /publish /p:UseAppHost=false
26+ RUN dotnet publish "HttpsRichardy.Federation.WebApi.csproj" -c Release -o /artifacts /publish /p:UseAppHost=false
2727
2828# final image to run the app
2929FROM base AS final
30- WORKDIR /app
30+ WORKDIR /artifacts
3131
3232ENV ASPNETCORE_URLS=http://+:8080
3333ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
3434
3535# copy published files from the build stage
36- COPY --from=build /app /publish .
36+ COPY --from=build /artifacts /publish .
3737
3838ENTRYPOINT ["dotnet" , "HttpsRichardy.Federation.WebApi.dll" ]
You can’t perform that action at this time.
0 commit comments