Remove explicitly copied dependencies, copy entire solution into the conainter and depends on the cache to reduce build time. Addd temporary solution file which does not contains the dcproj file to work around the issue that the dotnet cli cannot handle dcproj.
21 lines
445 B
Docker
21 lines
445 B
Docker
FROM microsoft/aspnetcore:2.0.3 AS base
|
|
WORKDIR /app
|
|
EXPOSE 80
|
|
|
|
FROM microsoft/aspnetcore-build:2.0 AS build
|
|
WORKDIR /src
|
|
COPY . .
|
|
RUN dotnet build -c Release -nowarn:msb3202,nu1503
|
|
|
|
FROM build AS publish
|
|
WORKDIR /src/src/Web/WebSPA
|
|
RUN npm rebuild node-sass
|
|
RUN npm install
|
|
RUN npm run build:prod
|
|
RUN dotnet publish --no-restore -c Release -o /app
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app .
|
|
ENTRYPOINT ["dotnet", "WebSPA.dll"]
|