-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (56 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
67 lines (56 loc) · 1.14 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
# Development stage
FROM node:20 AS development
WORKDIR /app
# Install system dependencies for Puppeteer
RUN apt-get update && apt-get install -y \
wget \
gnupg \
ca-certificates \
procps \
libxss1 \
libgconf-2-4 \
libxrandr2 \
libasound2 \
libpangocairo-1.0-0 \
libatk1.0-0 \
libcairo-gobject2 \
libgtk-3-0 \
libgdk-pixbuf2.0-0 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
ca-certificates \
fonts-liberation \
libnss3 \
lsb-release \
xdg-utils \
libnspr4 \
libxss1 \
libgbm1 \
libasound2 \
&& rm -rf /var/lib/apt/lists/*
# Install NestJS CLI globally
RUN npm install -g @nestjs/cli
# Install dependencies first (for better caching)
COPY package*.json ./
RUN npm ci
# Copy all files
COPY . .
# Keep container running in dev mode
CMD ["npm", "run", "start:dev"]
# Production stage
FROM node:20 AS production
WORKDIR /app
COPY package*.json ./
RUN npm install --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["node", "dist/main.js"]