FROM node:20-alpine WORKDIR /usr/src/app # Install dependencies for pdf-parse and other native modules RUN apk add --no-cache python3 make g++ # Copy package files COPY package*.json ./ # Install production dependencies RUN npm install --omit=dev # Copy application code COPY . . # Create logs directory RUN mkdir -p logs # Expose port EXPOSE 3003 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:3003/api/health || exit 1 # Start the application CMD ["node", "server.js"]