Skip to content

Commit 262dd69

Browse files
committed
node update, tini install, dockerfile style update
1 parent b3c346e commit 262dd69

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

Dockerfile

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
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

49
WORKDIR /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
1521
RUN 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 /
3325
ENV MS=1000 CTX_ROOT=/
@@ -36,4 +28,4 @@ EXPOSE 8080
3628

3729
HEALTHCHECK CMD node /app/healthcheck.js || exit 1
3830

39-
CMD ["npm","start"]
31+
CMD ["node","server.js"]

0 commit comments

Comments
 (0)