Dockerfile 722 B

123456789101112131415161718192021
  1. #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
  2. FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
  3. WORKDIR /app
  4. EXPOSE 80
  5. FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
  6. WORKDIR /src
  7. COPY ["MyFrontEnd/MyFrontEnd.csproj", "MyFrontEnd/"]
  8. RUN dotnet restore "MyFrontEnd/MyFrontEnd.csproj"
  9. COPY . .
  10. WORKDIR "/src/MyFrontEnd"
  11. RUN dotnet build "MyFrontEnd.csproj" -c Release -o /app/build
  12. FROM build AS publish
  13. RUN dotnet publish "MyFrontEnd.csproj" -c Release -o /app/publish /p:UseAppHost=false
  14. FROM base AS final
  15. WORKDIR /app
  16. COPY --from=publish /app/publish .
  17. ENTRYPOINT ["dotnet", "MyFrontEnd.dll"]