yanchenw e4fa15b813 Optimize multi-stage build Dockerfile
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.
2018-01-04 11:01:45 -08:00

18 lines
406 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/Services/Ordering/Ordering.API
RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Ordering.API.dll"]