Dockerfile 876 B

1234567891011121314151617181920212223242526
  1. FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
  2. WORKDIR /app
  3. EXPOSE 8080
  4. EXPOSE 443
  5. FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
  6. WORKDIR /src
  7. COPY ["MTWorkHR.API/MTWorkHR.API.csproj", "MTWorkHR.API/"]
  8. COPY ["MTWorkHR.Application/MTWorkHR.Application.csproj", "MTWorkHR.Application/"]
  9. COPY ["MTWorkHR.Core/MTWorkHR.Core.csproj", "MTWorkHR.Core/"]
  10. COPY ["MTWorkHR.Identity/MTWorkHR.Identity.csproj", "MTWorkHR.Identity/"]
  11. COPY ["MTWorkHR.Infrastructure/MTWorkHR.Infrastructure.csproj", "MTWorkHR.Infrastructure/"]
  12. RUN dotnet restore "MTWorkHR.API/MTWorkHR.API.csproj"
  13. COPY . .
  14. WORKDIR "/src//MTWorkHR.API"
  15. RUN dotnet build "MTWorkHR.API.csproj" -c Release -o /app/build
  16. FROM build AS publish
  17. RUN dotnet publish "MTWorkHR.API.csproj" -c Release -o /app/publish
  18. FROM base AS final
  19. WORKDIR /app
  20. COPY --from=publish /app/publish .
  21. ENTRYPOINT ["dotnet", "MTWorkHR.API.dll"]