Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 158fe02

Browse files
committed
CI
1 parent 59775d6 commit 158fe02

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Dockerfile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
FROM node:20-alpine AS base
22
WORKDIR /app
3-
ENV NODE_ENV=production
3+
# We need devDependencies for building
4+
ENV NODE_ENV=development
45
# Skip husky installation in Docker
56
ENV HUSKY=0
67

78
# Install pnpm
89
RUN npm install -g [email protected]
910

10-
# Copy source code
11-
COPY . .
11+
# Copy package files first for better caching
12+
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./
13+
COPY packages/shared/package.json ./packages/shared/
14+
COPY packages/client/package.json ./packages/client/
15+
COPY packages/server/package.json ./packages/server/
1216

1317
# Install dependencies with aggressive retry settings
1418
RUN pnpm config set network-timeout 300000 && \
1519
pnpm config set fetch-retries 5 && \
1620
pnpm config set fetch-retry-mintimeout 20000 && \
1721
pnpm config set fetch-retry-maxtimeout 120000 && \
18-
pnpm install --no-frozen-lockfile --network-concurrency=1 --ignore-scripts || \
19-
(sleep 5 && pnpm install --no-frozen-lockfile --network-concurrency=1 --ignore-scripts) || \
20-
(sleep 10 && pnpm install --no-frozen-lockfile --network-concurrency=1 --ignore-scripts)
22+
pnpm install --frozen-lockfile --ignore-scripts
23+
24+
# Copy source code
25+
COPY . .
2126

2227
# Build the application
2328
RUN pnpm build
2429

30+
# Set production environment for final images
31+
ENV NODE_ENV=production
32+
2533
# Client image
2634
FROM node:20-alpine AS client
2735
WORKDIR /app

0 commit comments

Comments
 (0)