20 lines
653 B
Docker
20 lines
653 B
Docker
|
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
|
||
|
WORKDIR /app
|
||
|
|
||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||
|
ARG BUILD_CONFIGURATION=Release
|
||
|
WORKDIR /src
|
||
|
COPY ["App1.csproj", "App1/"]
|
||
|
RUN dotnet restore "App1/App1.csproj"
|
||
|
WORKDIR "/src/App1"
|
||
|
COPY . .
|
||
|
RUN dotnet build "App1.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||
|
|
||
|
FROM build AS publish
|
||
|
ARG BUILD_CONFIGURATION=Release
|
||
|
RUN dotnet publish "App1.csproj" -c $BUILD_CONFIGURATION -o /app/publish --self-contained false --no-restore
|
||
|
|
||
|
FROM base AS final
|
||
|
WORKDIR /app
|
||
|
COPY --from=publish /app/publish .
|
||
|
ENTRYPOINT ["dotnet", "App1.dll"]
|