Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Dockerfile best practices to speed up builds #243

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions templates/Angular2Spa/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 4 additions & 6 deletions templates/KnockoutSpa/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 4 additions & 6 deletions templates/ReactReduxSpa/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 4 additions & 6 deletions templates/ReactSpa/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions templates/WebApplicationBasic/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down