-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
48 lines (36 loc) · 1.87 KB
/
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
45
46
47
48
###############################################################################
###############################################################################
## _______ _____ ______ _____ ##
## |__ __/ ____| ____| __ \ ##
## | | | (___ | |__ | | | | ##
## | | \___ \| __| | | | | ##
## | | ____) | |____| |__| | ##
## |_| |_____/|______|_____/ ##
## ##
## description : Dockerfile for TsED Application ##
## author : TsED team ##
## date : 2022-03-05 ##
## version : 2.0 ##
## ##
###############################################################################
###############################################################################
ARG NODE_VERSION=16.13.1
FROM node:${NODE_VERSION}-alpine as build
WORKDIR /opt
COPY package.json yarn.lock tsconfig.json tsconfig.compile.json .barrelsby.json ./
RUN yarn install --pure-lockfile
COPY ./src ./src
RUN yarn build
FROM node:${NODE_VERSION}-alpine as runtime
ENV WORKDIR /opt
WORKDIR $WORKDIR
RUN apk update && apk add build-base git curl
RUN npm install -g pm2
COPY --from=build /opt .
RUN yarn install --pure-lockfile --production
COPY ./views ./views
COPY processes.config.js .
EXPOSE 8081
ENV PORT 8081
ENV NODE_ENV production
CMD ["pm2-runtime", "start", "processes.config.js", "--env", "production"]