-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (24 loc) · 857 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
# TARGET: DEVELOPMENT
FROM mhart/alpine-node:10.3.0 AS development
RUN apk update && apk upgrade && apk add git && apk add python && apk add make && apk add g++ && npm i -g yarn
ENV APP_HOME /usr/app
VOLUME ${APP_HOME}
EXPOSE ${PORT}
WORKDIR $APP_HOME
CMD ["yarn", "run", "start:dev"]
# TARGET: TEST
FROM mhart/alpine-node:10.3.0 AS test
RUN apk update && apk upgrade && apk add git && apk add python && apk add make && apk add g++ && npm i -g yarn
ENV APP_HOME /usr/app
EXPOSE ${PORT}
WORKDIR $APP_HOME
ADD . $APP_HOME/
RUN yarn --production=false
# TARGET: PRODUCTION
FROM mhart/alpine-node:10.3.0 AS production
RUN apk update && apk upgrade && apk add git && apk add python && apk add make && apk add g++ && npm i -g yarn
COPY --from=test /usr/app /usr/app
EXPOSE ${PORT}
WORKDIR /usr/app
RUN yarn prestart:prod
CMD ["node", "dist/main.js"]