Skip to content

Commit 1d1644a

Browse files
authored
refactor: TTL-720 increased build speed (#964)
* refactor: TTL-720 increased chown speed * refactor: TTL-720 added newline at end of file
1 parent b543374 commit 1d1644a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Docker/Dockerfile.dev

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ FROM node:14
22

33
ENV USERNAME timetracker
44
ENV HOME /home/${USERNAME}
5-
RUN useradd -ms /bin/bash ${USERNAME}
5+
RUN useradd --create-home -ms /bin/bash ${USERNAME}
66

77
WORKDIR ${HOME}/time-tracker-ui
8-
COPY package.json package-lock.json ./
8+
COPY package*.json ./
9+
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui
910
RUN npm cache clean --force && npm install
10-
COPY . .
11-
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui \
12-
&& chmod -R 777 ${HOME}/time-tracker-ui
11+
COPY --chown=${USERNAME}:${USERNAME} . .
1312

1413
USER ${USERNAME}
1514
EXPOSE 4200
16-
CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
15+
CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck=false --poll 2000

Docker/Dockerfile.test

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ RUN mkdir -p /opt/selenium \
3131
&& curl http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -o /opt/selenium/chromedriver_linux64.zip \
3232
&& cd /opt/selenium; unzip /opt/selenium/chromedriver_linux64.zip; rm -rf chromedriver_linux64.zip; ln -fs /opt/selenium/chromedriver /usr/local/bin/chromedriver;
3333

34-
RUN useradd -ms /bin/bash ${USERNAME}
34+
35+
RUN useradd --create-home -ms /bin/bash ${USERNAME}
3536

3637
WORKDIR ${HOME}/time-tracker-ui
37-
COPY package.json package-lock.json ./
38-
RUN npm cache clean --force && npm install
39-
COPY . .
38+
COPY package*.json ./
4039
RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui
41-
RUN chmod -R 777 ${HOME}/time-tracker-ui
40+
RUN npm cache clean --force && npm install
41+
COPY --chown=${USERNAME}:${USERNAME} . .
42+
4243

4344
USER ${USERNAME}
4445
EXPOSE 4200

0 commit comments

Comments
 (0)