Skip to content

Commit c32641c

Browse files
GuLozada99Gustavo Lozada
andauthored
Set copy of package.json and npm install before copying all other project files (#906)
* Set copy of package.json and npm install before copying all other project files * Fix error on COPY on Dockerfiles Co-authored-by: Gustavo Lozada <[email protected]>
1 parent 63d8d3d commit c32641c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Docker/Dockerfile.dev

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ ENV HOME /home/${USERNAME}
55
RUN useradd -ms /bin/bash ${USERNAME}
66

77
WORKDIR ${HOME}/time-tracker-ui
8+
COPY package.json package-lock.json ./
9+
RUN npm cache clean --force && npm install
810
COPY . .
911
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui \
1012
&& chmod -R 777 ${HOME}/time-tracker-ui
1113

1214
USER ${USERNAME}
13-
RUN npm cache clean --force && npm install
1415
EXPOSE 4200
1516
CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck

Docker/Dockerfile.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ RUN mkdir -p /opt/selenium \
3434
RUN useradd -ms /bin/bash ${USERNAME}
3535

3636
WORKDIR ${HOME}/time-tracker-ui
37+
COPY package.json package-lock.json ./
38+
RUN npm cache clean --force && npm install
3739
COPY . .
3840
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui
3941
RUN chmod -R 777 ${HOME}/time-tracker-ui
4042

4143
USER ${USERNAME}
4244
EXPOSE 4200
4345
EXPOSE 9876
44-
RUN npm cache clean --force && npm install
4546
CMD npm run ci-test

0 commit comments

Comments
 (0)