-
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 769 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 769 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
## Base
FROM node:24-alpine AS base
WORKDIR /app
RUN corepack enable
## Dependencies (production)
FROM base AS dependencies
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN HUSKY=0 pnpm install --prod --frozen-lockfile --ignore-scripts
## Builder
FROM base AS builder
RUN apk add --no-cache git
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN HUSKY=0 pnpm install --frozen-lockfile
COPY . .
RUN pnpm compile
## Runner
FROM base AS runner
WORKDIR /app
USER node
COPY --from=dependencies --chown=node:node /app/node_modules/ ./node_modules/
COPY --from=builder --chown=node:node /app/dist/ ./dist/
COPY --from=builder --chown=node:node /app/package.json ./
ENV NODE_ENV=production
CMD ["node", "--enable-source-maps", "dist/src/index.js"]