-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 799 Bytes
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 799 Bytes
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
# ---- Build Stage ----
FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY app ./app
COPY bootstrap ./bootstrap
COPY config ./config
COPY database ./database
COPY public ./public
COPY routes ./routes
COPY resources ./resources
COPY tests ./tests
COPY vitest.config.ts ./
COPY eslint.config.mjs ./
RUN npm run build:prod
# ---- Production Stage ----
FROM node:22-alpine
RUN npm install -g pm2
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
# Copy the entire dist/ contents as the app root
COPY --from=builder /app/dist/ ./
COPY ecosystem.config.js ./
ENV NODE_ENV=production
ENV APP_ENV=production
ENV APP_DEBUG=false
ENV APP_PORT=3000
EXPOSE 3000
CMD ["pm2-runtime", "ecosystem.config.js"]