forked from diogocezar/pizzaiolo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (34 loc) · 945 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM node:16-bullseye as ts-compiler
WORKDIR /usr/app
COPY package*.json ./
COPY tsconfig*.json ./
RUN yarn
COPY . ./
RUN npx prisma generate
RUN yarn run build
FROM node:16-bullseye as ts-remover
WORKDIR /usr/app
COPY --from=ts-compiler /usr/app/package*.json ./
COPY --from=ts-compiler /usr/app/yarn.lock ./
COPY --from=ts-compiler /usr/app/dist ./
COPY --from=ts-compiler /usr/app/tsconfig.*.json ./
COPY --from=ts-compiler /usr/app/tsconfig.json ./
# When implements the prisma client, uncomment this line
#COPY --from=ts-compiler /usr/app/prisma ./
# Run when test local
# COPY --from=ts-compiler /usr/app/.env ./
RUN yarn
RUN npx prisma generate
FROM node:16-bullseye
RUN apt update \
&& apt install -y \
bzip2 \
build-essential \
chrpath \
libssl-dev \
libxft-dev
RUN npm install -g @nestjs/cli
WORKDIR /usr/app
COPY --from=ts-remover /usr/app ./
EXPOSE 3000
CMD ["yarn", "run" ,"start:prod"]