Skip to content

Commit 02b56bb

Browse files
mcordellmunen
authored andcommittedOct 29, 2021
Modify Dockerfile to use cacheing
By only copying the dependency lockfiles to the directory, running yarn install, we can utilize docker cacheing to avoid run yarn install everytime to the image is built.
1 parent 090e6ac commit 02b56bb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎Dockerfile

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/http\:\/\/mirror.clarkson.edu/g'
88

99
RUN apk add --no-cache bash yarn
1010

11-
COPY . /opt/organice
1211
WORKDIR /opt/organice
1312

14-
RUN yarn install \
15-
&& yarn global add serve \
13+
COPY package.json yarn.lock /opt/organice/
14+
15+
RUN yarn install
16+
17+
COPY . /opt/organice
18+
19+
RUN yarn global add serve \
1620
&& yarn build \
1721
&& yarn cache clean \
1822
&& rm -rf node_modules

0 commit comments

Comments
 (0)
Please sign in to comment.