Skip to content

Commit ae9ea75

Browse files
author
Mano Marks
authored
Merge pull request dockersamples#101 from thaJeztah/improve-result-dockerfile
Optimize result image
2 parents e5dfa47 + 45788a5 commit ae9ea75

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

result/Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
FROM node:8.9-slim
1+
FROM node:8.9-alpine
22

3+
RUN mkdir -p /app
34
WORKDIR /app
45

56
RUN npm install -g nodemon
6-
ADD package.json /app/package.json
7-
RUN npm config set registry http://registry.npmjs.org
8-
RUN npm install && npm ls
9-
RUN mv /app/node_modules /node_modules
10-
11-
ADD . /app
7+
RUN npm config set registry https://registry.npmjs.org
8+
COPY package.json /app/package.json
9+
RUN npm install \
10+
&& npm ls \
11+
&& npm cache clean --force \
12+
&& mv /app/node_modules /node_modules
13+
COPY . /app
1214

1315
ENV PORT 80
1416
EXPOSE 80

0 commit comments

Comments
 (0)