forked from dockersamples/docker-swarm-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 793 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
32
33
34
35
36
37
38
39
#Latest version of node tested on.
FROM node:8.2.1-alpine AS dist
WORKDIR /app
# Only run npm install if these files change.
ADD ./package.json /app/package.json
# Install dependencies
RUN npm install
# Add the rest of the sources
ADD . /app
RUN npm run dist
FROM node:8.2.1-alpine
WORKDIR /app
ADD ./cfg/* /app/cfg/
ADD ./src/* /app/src/
ADD ./create-index.js /app
ADD ./index.tpl /app
ADD ./server.js /app
ADD ./healthcheck.js /app
COPY --from=dist /app/dist/* /app/dist/
COPY --from=dist /app/package.json /app/package.json
RUN npm install
# MS : Number of milliseconds between polling requests. Default is 1000.
# CTX_ROOT : Context root of the application. Default is /
ENV MS=1000 CTX_ROOT=/
EXPOSE 8080
HEALTHCHECK CMD node /app/healthcheck.js || exit 1
CMD ["npm","start"]