npm ci fails when the lockfile was generated on a different platform or npm version than what runs inside the container. npm install is more forgiving and resolves the exit code 1 in the build stage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
305 B
Docker
18 lines
305 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
|
|
RUN npm install express cors docx
|
|
COPY server.js ./
|
|
COPY --from=build /app/build ./build
|
|
|
|
ENV DATA_DIR=/data
|
|
VOLUME ["/data"]
|
|
EXPOSE 4000
|
|
CMD ["node", "server.js"]
|