forked from ecency/ecency-vision
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (26 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
40 lines (26 loc) · 1.14 KB
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
32
33
34
35
36
37
38
39
40
FROM node:12.16.2 as base
WORKDIR /var/app
COPY package.json yarn.lock ./
COPY src/desktop/package.json src/desktop/yarn.lock ./src/desktop/
RUN yarn install --non-interactive --frozen-lockfile --ignore-optional
RUN yarn install --non-interactive --frozen-lockfile --ignore-optional --cwd src/desktop
COPY . .
RUN yarn build
### REMOVE DEV DEPENDENCIES ##
FROM base as dependencies
RUN yarn install --non-interactive --frozen-lockfile --ignore-optional --production
### BUILD MINIFIED PRODUCTION ##
FROM node:12.16.2-alpine as production
# Add Tini
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
WORKDIR /var/app
COPY --from=dependencies /var/app/package.json /var/app/package.json
COPY --from=dependencies /var/app/healthCheck.js /var/app/healthCheck.js
COPY --from=dependencies /var/app/public /var/app/public
COPY --from=dependencies /var/app/build /var/app/build
COPY --from=dependencies /var/app/node_modules /var/app/node_modules
HEALTHCHECK --interval=15s --timeout=5s CMD node /var/app/healthCheck.js
CMD [ "yarn", "run", "start:prod" ]