Dockerfile 884 B

1234567891011121314151617181920212223242526272829
  1. # Use the official .NET SDK image as a build stage
  2. FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
  3. WORKDIR /app
  4. # Copy the solution and global.json to the container
  5. COPY ./Products.sln ./global.json ./
  6. # Copy the entire project directory to the container
  7. COPY ./Products.API ./Products.API
  8. COPY ./Products.Business ./Products.Business
  9. COPY ./Products.Common ./Products.Common
  10. COPY ./Products.Backoffice ./Products.Backoffice
  11. # Restore dependencies for the solution
  12. RUN dotnet restore Products.sln
  13. # Build the "Backoffice" project
  14. WORKDIR /app/Products.Backoffice
  15. RUN dotnet publish -c Release -o out
  16. # Use the official .NET runtime image as the final base image
  17. FROM mcr.microsoft.com/dotnet/aspnet:8.0
  18. WORKDIR /app
  19. COPY --from=build /app/Products.Backoffice/out ./
  20. EXPOSE 80
  21. # Set the entry point for the Backoffice application
  22. ENTRYPOINT ["dotnet", "Products.Backoffice.dll"]