-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (21 loc) · 664 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
FROM node:14-alpine as builder
WORKDIR /app
COPY ./package.json ./
RUN yarn --production --silent
COPY . .
COPY ./.env ./.env
RUN yarn build
FROM node:14-alpine
# set working directory
WORKDIR /app
# ENV PATH ./node_modules/.bin:$PATH
# install app dependencies
RUN yarn add express dotenv http-proxy-middleware compression faker http-status-codes --silent
RUN yarn global add pm2
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/mock ./mock
COPY --from=builder /app/server ./server
COPY --from=builder /app/.env ./.env
COPY --from=builder /app/processes.json ./
EXPOSE 8000
CMD ["pm2", "start", "processes.json", "--silent", "--no-daemon"]