From 2df6759406b9323d10f0ba340898460b02773886 Mon Sep 17 00:00:00 2001 From: Peter Haza Date: Sat, 9 Feb 2019 21:02:48 +0100 Subject: [PATCH] Take advantage of docker cache (#179) By moving these two RUNs above COPY . ., docker will be able to cache the installation of nodejs and speed up builds. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fae8efba..62e9cbad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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