Skip to content

Commit 03e64b4

Browse files
committed
fix: copy lockfile into Docker builder stage and use npm ci
The builder stages in both Dockerfiles copied only package.json, causing npm install to resolve caret ranges to the latest compatible versions rather than using the locked versions. This pulled better-auth 1.5.1 (which has breaking type changes) instead of the locked 1.4.9, failing every PR's integration tests. Copy package-lock.json alongside package.json and switch to npm ci for deterministic, reproducible builds.
1 parent dced04c commit 03e64b4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Dockerfile.auth

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ FROM node:22-alpine AS builder
33

44
WORKDIR /auth-builder
55

6-
COPY ./package.json ./
6+
COPY ./package.json ./package-lock.json ./
77
COPY ./tsconfig.base.json ./
88
COPY ./shared ./shared
99
COPY ./apps/auth ./apps/auth
1010

11-
RUN npm install && npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/auth-service
11+
RUN npm ci && npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/auth-service
1212

1313
#Production stage
1414
FROM node:22-alpine AS prod

Dockerfile.backend

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ FROM node:22-alpine AS builder
33

44
WORKDIR /builder
55

6-
COPY ./package.json ./
6+
COPY ./package.json ./package-lock.json ./
77
COPY ./tsconfig.base.json ./
88
COPY ./shared ./shared
99
COPY ./apps/backend ./apps/backend
1010

11-
RUN npm install && npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/backend
11+
RUN npm ci && npm run build --workspace=@wxyc/database --workspace=shared/** --workspace=@wxyc/backend
1212

1313
#Production stage
1414
FROM node:22-alpine AS prod

0 commit comments

Comments
 (0)