Skip to content

Commit fe14f86

Browse files
committed
feat: added healthcheck and slightly improved container start up time
1 parent ee93280 commit fe14f86

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable
1212
RUN apt-get update
1313
RUN apt-get install -yq google-chrome-stable
1414

15-
# set working directory
15+
# use changes to package.json to force Docker not to use the cache
16+
# when we change our application's angular dependencies:
17+
COPY package.json /tmp/package.json
18+
RUN cd /tmp && yarn install --silent
19+
# RUN yarn global add --silent @angular/cli@8.3.14
20+
RUN mkdir -p /app && cp -a /tmp/node_modules /app/
21+
22+
# From here we load our application's code in, therefore the previous docker
23+
# "layer" thats been cached will be used if possible
1624
WORKDIR /app
17-
18-
# add `/app/node_modules/.bin` to $PATH
19-
ENV PATH /app/node_modules/.bin:$PATH
20-
21-
# install and cache app dependencies
22-
COPY package.json /app/package.json
23-
RUN yarn add --silent node-sass
24-
RUN yarn install --silent
25-
RUN yarn global add --silent @angular/cli@8.3.14
26-
27-
# add app
2825
COPY . /app
2926

3027
# Expose the port the app runs in
3128
EXPOSE 4200
3229

3330
# Serve the app
3431
CMD ["yarn", "docker"]
32+
33+
HEALTHCHECK --interval=5m --timeout=3s \
34+
CMD curl -f http://localhost/ || exit 1

0 commit comments

Comments
 (0)