-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 822 Bytes
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 822 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
FROM node:20-slim AS deps
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* ./
# Install production dependencies only
RUN npm ci --omit=dev --legacy-peer-deps --ignore-scripts
FROM node:20-slim AS builder
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* ./
# Install all dependencies (including dev)
RUN HUSKY=0 npm ci --legacy-peer-deps
# Copy sources and build
COPY tsconfig.json ./
COPY src ./src
COPY README.md ./README.md
RUN npm run build
FROM node:20-slim AS runner
ENV NODE_ENV=production
WORKDIR /app
# Copy production node_modules and built app
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./
ENV HOST=0.0.0.0 \
PORT=3000
EXPOSE 3000
CMD ["node", "dist/index.js", "--http"]