# Build stage FROM node:20-bookworm-slim AS builder WORKDIR /app RUN apt-get update && apt-get install -y --no-install-recommends \ python3 make g++ pkg-config \ && rm -rf /var/lib/apt/lists/* COPY package*.json ./ RUN npm install --no-audit --no-fund COPY . . RUN npm run build # Runtime stage FROM node:20-bookworm-slim WORKDIR /app ENV NODE_ENV=production COPY package*.json ./ COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/dist ./dist COPY --from=builder /app/client/public ./client/public COPY --from=builder /app/attached_assets ./attached_assets COPY --from=builder /app/server ./server EXPOSE 5000 CMD ["node", "dist/index.cjs"]