-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
45 lines (33 loc) · 967 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
FROM node:20.13.1-bullseye-slim
COPY apps/api/src/config/default.cf /usr/local/etc/isolate
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
locales \
locales-all \
libcap-dev \
&& rm -rf /var/lib/apt/lists/*
RUN npm i -g \
npm@9.5.1 \
pnpm@8.9.0
WORKDIR /usr/src/app
RUN npm install -g pnpm@8.9.0 --loglevel notice
RUN npm i pm2 -g
COPY package.json .
COPY .npmrc .
COPY apps/api ./apps/api
COPY packages/client ./packages/client
COPY libs/dal ./libs/dal
COPY libs/shared ./libs/shared
COPY libs/services ./libs/services
COPY tsconfig.json .
COPY tsconfig.base.json .
COPY nx.json .
COPY pnpm-workspace.yaml .
COPY pnpm-lock.yaml .
RUN pnpm i
WORKDIR /usr/src/app/apps/api
RUN cp src/.example.env dist/src/.env
RUN cp src/.env.test dist/src/.env.test
RUN cp src/.env.development dist/src/.env.development
RUN cp src/.env.production dist/src/.env.production
CMD [ "pm2-runtime", "/usr/src/app/apps/api/dist/main.js" ]