-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (21 loc) · 951 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:10.13-alpine as build
ENV NODE_ENV production
WORKDIR /spa-prod
COPY ./package.json /spa-prod/package.json
COPY ./yarn.lock /spa-prod/yarn.lock
COPY ./tsconfig.build.json /spa-prod/tsconfig.build.json
RUN yarn install --pure-lockfile --production=false
COPY ./src /spa-prod/src
RUN yarn build
RUN yarn install --pure-lockfile --production=true
FROM node:10.13-alpine as runtime
WORKDIR /app
EXPOSE 8080
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD curl --fail http://localhost:8080/healthz || exit 1
CMD /usr/local/bin/node /spa-prod/dist/cli.js
RUN apk add --no-cache curl
COPY --from=build --chown=node:node /spa-prod/package.json /spa-prod/package.json
COPY --from=build --chown=node:node /spa-prod/yarn.lock /spa-prod/yarn.lock
COPY --from=build --chown=node:node /spa-prod/dist /spa-prod/dist
COPY --from=build --chown=node:node /spa-prod/node_modules /spa-prod/node_modules
USER node