-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
37 lines (29 loc) · 903 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
FROM node:10 as builder
ARG SERVICE
WORKDIR /usr/src/app
COPY --chown=node:node package*.json lerna.json ./
COPY --chown=node:node packages/ ./packages
COPY --chown=node:node services/${SERVICE} ./services/${SERVICE}
RUN npm install --loglevel notice --unsafe-perm
ENV NODE_ENV=production \
PORT=3000 \
SERVICE_NAME=${SERVICE}
HEALTHCHECK --interval=30s \
--timeout=2s \
--retries=10 \
CMD node services/${SERVICE_NAME}/src/healthcheck.js
EXPOSE 3000
CMD ["npm", "--prefix", "services/${SERVICE}", "start"]
FROM node:10-alpine
ARG SERVICE
WORKDIR /usr/src/app
COPY --chown=node:node --from=builder /usr/src/app .
ENV NODE_ENV=production \
PORT=3000 \
SERVICE_NAME=${SERVICE}
HEALTHCHECK --interval=30s \
--timeout=2s \
--retries=10 \
CMD node services/${SERVICE_NAME}/src/healthcheck.js
EXPOSE 3000
CMD ["npm", "--prefix", "services/${SERVICE}", "start"]