File tree Expand file tree Collapse file tree 1 file changed +12
-20
lines changed
Expand file tree Collapse file tree 1 file changed +12
-20
lines changed Original file line number Diff line number Diff line change 11# Latest version of node tested on.
2- FROM node:8-alpine AS dist
2+ FROM node:12-alpine AS dist
3+
4+
5+ # Tini is recommended for Node apps https://github.com/krallin/tini
6+ RUN apk add --no-cache tini
7+ ENTRYPOINT ["/sbin/tini" , "--" ]
38
49WORKDIR /app
510
611# Only run npm install if these files change.
7- ADD ./ package.json /app/package.json
12+ COPY package* .json ./
813
914# Install dependencies
10- RUN npm install
15+ RUN npm ci
1116
12- # Add the rest of the sources
13- ADD . /app
17+ # Add the rest of the source
18+ COPY . .
1419
20+ # run webpack
1521RUN npm run dist
1622
17-
18- FROM node:8-alpine
19-
20- WORKDIR /app
21- ADD ./cfg/* /app/cfg/
22- ADD ./src/* /app/src/
23- ADD ./create-index.js /app
24- ADD ./index.tpl /app
25- ADD ./server.js /app
26- ADD ./healthcheck.js /app
27- COPY --from=dist /app/dist/* /app/dist/
28- COPY --from=dist /app/package.json /app/package.json
29- RUN npm install
30-
3123# MS : Number of milliseconds between polling requests. Default is 1000.
3224# CTX_ROOT : Context root of the application. Default is /
3325ENV MS=1000 CTX_ROOT=/
@@ -36,4 +28,4 @@ EXPOSE 8080
3628
3729HEALTHCHECK CMD node /app/healthcheck.js || exit 1
3830
39- CMD ["npm " ,"start " ]
31+ CMD ["node " ,"server.js " ]
You can’t perform that action at this time.
0 commit comments