forked from mohsenasm/swarm-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (29 loc) · 920 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
40
41
42
43
44
FROM node:8-alpine AS base
RUN apk add --update tini curl \
&& rm -r /var/cache
ENTRYPOINT ["/sbin/tini", "--"]
WORKDIR /home/node/app
FROM base AS dependencies
ENV NODE_ENV production
COPY package.json yarn.lock ./
RUN yarn install --production
# elm doesn't work under alpine 6 or 8
FROM node:6-slim AS elm-build
WORKDIR /home/node/app
RUN apt-get update && \
apt-get install -y netbase
RUN npm install -g npx && \
npm install -g [email protected] --silent
COPY elm-package.json ./
RUN elm package install -y
COPY . .
RUN elm make Main.elm --output=client/index.js
FROM base AS release
WORKDIR /home/node/app
COPY --from=dependencies /home/node/app/node_modules node_modules
COPY --from=elm-build /home/node/app/client/ client
COPY server server
HEALTHCHECK --interval=5s --timeout=3s \
CMD curl --fail http://localhost:$PORT/_health || exit 1
# Run under Tini
CMD ["node", "server/index.js"]