Skip to content

Commit

Permalink
Take advantage of docker cache (loic-sharma#179)
Browse files Browse the repository at this point in the history
By moving these two RUNs above COPY . ., docker will be able to cache the installation of nodejs and speed up builds.
  • Loading branch information
phaza authored and loic-sharma committed Feb 9, 2019
1 parent f71a90b commit 2df6759
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.2-sdk AS build
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
WORKDIR /src
COPY /src .
RUN dotnet restore BaGet
RUN dotnet build BaGet -c Release -o /app

FROM build AS publish
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
RUN dotnet publish BaGet -c Release -o /app

FROM base AS final
Expand Down

0 comments on commit 2df6759

Please sign in to comment.