# Use Node.js 18 Alpine for smaller image size FROM node:18-alpine # Set working directory WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm install --only=production # Copy server source code COPY . ./ # Create a non-root user RUN addgroup -g 1001 -S nodejs RUN adduser -S nodejs -u 1001 # Change ownership of the app directory RUN chown -R nodejs:nodejs /app USER nodejs # Expose port EXPOSE 7860 # Health check with longer start period and more retries HEALTHCHECK --interval=60s --timeout=10s --start-period=120s --retries=5 \ CMD curl -f http://localhost:7860/api/health || exit 1 # Start the application # rebuild trigger 2025-09-01T14:18:50Z CMD npm start # rebuild trigger 2025-09-02T03:17:52Z