Skip to content

Commit 01e02ab

Browse files
committed
Optimized dockerfile for next iterators (better layer caching -- quicker image rebuilds)
1 parent 3fe2441 commit 01e02ab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@ FROM node
33
# Set the working directory to /app
44
WORKDIR /app
55

6-
COPY package*.json ./
7-
8-
# Run npm install to install app dependencies
9-
RUN npm install
10-
11-
# Set the PATH env variable
12-
# ENV PATH="/usr/local/bin:${PATH}"
13-
# COPY /usr/local/bin/docker /usr/local/bin/docker
146
ENV DOCKERVERSION=19.03.12
7+
158
RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
169
&& tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 -C /usr/local/bin docker/docker \
1710
&& rm docker-${DOCKERVERSION}.tgz
1811

12+
13+
COPY package*.json ./
14+
15+
# Run npm install to install app dependencies
16+
RUN npm install
17+
1918
# Copy the current directory contents into the container at /app
2019
COPY . .
2120

@@ -26,3 +25,4 @@ EXPOSE 4000
2625
CMD ["npm", "start"]
2726

2827

28+

0 commit comments

Comments
 (0)