This repository was archived by the owner on May 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 1
1
FROM node:20-alpine AS base
2
2
WORKDIR /app
3
- ENV NODE_ENV=production
3
+ # We need devDependencies for building
4
+ ENV NODE_ENV=development
4
5
# Skip husky installation in Docker
5
6
ENV HUSKY=0
6
7
7
8
# Install pnpm
8
9
RUN npm install -g
[email protected]
9
10
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/
12
16
13
17
# Install dependencies with aggressive retry settings
14
18
RUN pnpm config set network-timeout 300000 && \
15
19
pnpm config set fetch-retries 5 && \
16
20
pnpm config set fetch-retry-mintimeout 20000 && \
17
21
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 . .
21
26
22
27
# Build the application
23
28
RUN pnpm build
24
29
30
+ # Set production environment for final images
31
+ ENV NODE_ENV=production
32
+
25
33
# Client image
26
34
FROM node:20-alpine AS client
27
35
WORKDIR /app
You can’t perform that action at this time.
0 commit comments