The production stage was using an ad-hoc npm install without package.json, which could pull unexpected package versions and lost the lockfile guarantee. Moved all React/build/test/type packages to devDependencies so the production stage can use npm install --omit=dev cleanly, installing only express, cors, and docx — exactly what server.js needs. Regenerated lockfile to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
320 B
Docker
19 lines
320 B
Docker
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install --omit=dev
|
|
COPY server.js ./
|
|
COPY --from=build /app/build ./build
|
|
|
|
ENV DATA_DIR=/data
|
|
VOLUME ["/data"]
|
|
EXPOSE 4000
|
|
CMD ["node", "server.js"]
|