fix(docker): copy workspace package.json files before npm install
npm workspaces needs shared/package.json and server/package.json present at install time to link @ttrpg/shared, otherwise the build stage fails with "Module not found: Error: Can't resolve '@ttrpg/shared'". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -7,8 +7,11 @@ LABEL stage="build-local-testing"
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package.json and package-lock.json (or yarn.lock)
|
# Copy root package.json/lockfile plus workspace manifests so npm can
|
||||||
|
# resolve the @ttrpg/shared and server workspace links during install.
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
COPY shared/package.json ./shared/
|
||||||
|
COPY server/package.json ./server/
|
||||||
|
|
||||||
# Install dependencies using the lock file for consistency
|
# Install dependencies using the lock file for consistency
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|||||||
Reference in New Issue
Block a user