pnpm install --frozen-lockfile fails in Docker with ENOENT when pnpm-lock.yaml references patched dependencies (jsdoc@3.6.11.patch) but the patches/ directory is not copied into the container. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
693 B
Docker
33 lines
693 B
Docker
FROM node:22-alpine
|
|
|
|
ARG VITE_BE_API_URL
|
|
ARG VITE_BE_WS_URL
|
|
|
|
WORKDIR /app
|
|
|
|
# Install pnpm
|
|
RUN npm install -g pnpm
|
|
|
|
# Copy workspace files
|
|
COPY pnpm-workspace.yaml .
|
|
COPY pnpm-lock.yaml .
|
|
COPY package.json .
|
|
|
|
# Copy patches (pnpm patchedDependencies)
|
|
COPY patches ./patches
|
|
|
|
# Copy service
|
|
COPY services/frontend ./services/frontend
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Build frontend (env vars injected at build time)
|
|
RUN VITE_BE_API_URL=${VITE_BE_API_URL} VITE_BE_WS_URL=${VITE_BE_WS_URL} pnpm --filter './services/frontend' run build
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Start frontend (production preview)
|
|
CMD ["pnpm", "--filter", "./services/frontend", "run", "preview"]
|