diff --git a/templates/Angular2Spa/Dockerfile b/templates/Angular2Spa/Dockerfile
index b382b9ea..b828f968 100644
--- a/templates/Angular2Spa/Dockerfile
+++ b/templates/Angular2Spa/Dockerfile
@@ -1,16 +1,14 @@
 FROM microsoft/dotnet:latest
 
-COPY . /app
-
-WORKDIR /app
-
-# Add Node.js to the container. If you don't want to wait for this to install every
-# time you rebuild your container, consider creating an image that has it preinstalled.
 RUN apt-get update
 RUN apt-get install -y build-essential nodejs nodejs-legacy
 
+WORKDIR /app
+
+COPY project.json .
 RUN ["dotnet", "restore"]
 
+COPY . /app
 RUN ["dotnet", "build"]
 
 EXPOSE 5000/tcp
diff --git a/templates/KnockoutSpa/Dockerfile b/templates/KnockoutSpa/Dockerfile
index b382b9ea..b828f968 100644
--- a/templates/KnockoutSpa/Dockerfile
+++ b/templates/KnockoutSpa/Dockerfile
@@ -1,16 +1,14 @@
 FROM microsoft/dotnet:latest
 
-COPY . /app
-
-WORKDIR /app
-
-# Add Node.js to the container. If you don't want to wait for this to install every
-# time you rebuild your container, consider creating an image that has it preinstalled.
 RUN apt-get update
 RUN apt-get install -y build-essential nodejs nodejs-legacy
 
+WORKDIR /app
+
+COPY project.json .
 RUN ["dotnet", "restore"]
 
+COPY . /app
 RUN ["dotnet", "build"]
 
 EXPOSE 5000/tcp
diff --git a/templates/ReactReduxSpa/Dockerfile b/templates/ReactReduxSpa/Dockerfile
index b382b9ea..b828f968 100644
--- a/templates/ReactReduxSpa/Dockerfile
+++ b/templates/ReactReduxSpa/Dockerfile
@@ -1,16 +1,14 @@
 FROM microsoft/dotnet:latest
 
-COPY . /app
-
-WORKDIR /app
-
-# Add Node.js to the container. If you don't want to wait for this to install every
-# time you rebuild your container, consider creating an image that has it preinstalled.
 RUN apt-get update
 RUN apt-get install -y build-essential nodejs nodejs-legacy
 
+WORKDIR /app
+
+COPY project.json .
 RUN ["dotnet", "restore"]
 
+COPY . /app
 RUN ["dotnet", "build"]
 
 EXPOSE 5000/tcp
diff --git a/templates/ReactSpa/Dockerfile b/templates/ReactSpa/Dockerfile
index b382b9ea..b828f968 100644
--- a/templates/ReactSpa/Dockerfile
+++ b/templates/ReactSpa/Dockerfile
@@ -1,16 +1,14 @@
 FROM microsoft/dotnet:latest
 
-COPY . /app
-
-WORKDIR /app
-
-# Add Node.js to the container. If you don't want to wait for this to install every
-# time you rebuild your container, consider creating an image that has it preinstalled.
 RUN apt-get update
 RUN apt-get install -y build-essential nodejs nodejs-legacy
 
+WORKDIR /app
+
+COPY project.json .
 RUN ["dotnet", "restore"]
 
+COPY . /app
 RUN ["dotnet", "build"]
 
 EXPOSE 5000/tcp
diff --git a/templates/WebApplicationBasic/Dockerfile b/templates/WebApplicationBasic/Dockerfile
index 10eb41aa..134c714c 100644
--- a/templates/WebApplicationBasic/Dockerfile
+++ b/templates/WebApplicationBasic/Dockerfile
@@ -1,11 +1,11 @@
 FROM microsoft/dotnet:latest
 
-COPY . /app
-
 WORKDIR /app
 
+COPY project.json .
 RUN ["dotnet", "restore"]
 
+COPY . /app
 RUN ["dotnet", "build"]
 
 EXPOSE 5000/tcp