Skip to content

Commit 969d805

Browse files
committed
pnpm
1 parent dcd123d commit 969d805

File tree

3 files changed

+17
-1928
lines changed

3 files changed

+17
-1928
lines changed

Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,40 @@
22
# Use a Node.js image as the base for building the application
33
FROM node:22-alpine AS builder
44

5+
# Enable pnpm via corepack
6+
RUN corepack enable && corepack prepare pnpm@latest --activate
7+
58
# Set the working directory inside the container
69
WORKDIR /app
710

8-
# Copy package.json and package-lock.json to install dependencies
9-
COPY package.json package-lock.json ./
11+
# Copy package.json and pnpm-lock.yaml to install dependencies
12+
COPY package.json pnpm-lock.yaml ./
1013

1114
# Install dependencies (ignoring scripts to prevent running the prepare script)
12-
RUN npm install --ignore-scripts
15+
RUN pnpm install --frozen-lockfile --ignore-scripts
1316

1417
# Copy the rest of the application source code
1518
COPY . .
1619

1720
# Build the application using TypeScript
18-
RUN npm run build
21+
RUN pnpm run build
1922

2023
# Use a smaller Node.js image for the final image
2124
FROM node:22-slim AS release
2225

26+
# Enable pnpm via corepack
27+
RUN corepack enable && corepack prepare pnpm@latest --activate
28+
2329
# Set the working directory inside the container
2430
WORKDIR /app
2531

2632
# Copy the built application from the builder stage
2733
COPY --from=builder /app/dist /app/dist
2834
COPY --from=builder /app/package.json /app/package.json
29-
COPY --from=builder /app/package-lock.json /app/package-lock.json
35+
COPY --from=builder /app/pnpm-lock.yaml /app/pnpm-lock.yaml
3036

3137
# Install only production dependencies
32-
RUN npm ci --omit=dev --ignore-scripts
38+
RUN pnpm install --prod --frozen-lockfile --ignore-scripts
3339

3440
# Set environment variables for API key and custom API URL if needed
3541

0 commit comments

Comments
 (0)