-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
48 lines (35 loc) · 1.83 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 : 2023-12-11 ##
## version : 3.0 ##
## ##
###############################################################################
###############################################################################
ARG NODE_VERSION=20.10.0
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 . .
EXPOSE 8081
ENV PORT 8081
ENV NODE_ENV production
CMD ["pm2-runtime", "start", "processes.config.js", "--env", "production"]