# Use Node.js 18 Alpine for a lightweight image FROM node:18-alpine # Set working directory WORKDIR /app # Copy dependency files first for better caching COPY package*.json ./ # Install dependencies RUN npm install # Copy the rest of your app COPY . . # Copy production environment file COPY .prod .env # Expose the app port EXPOSE 15869 # Install PM2 globally RUN npm install pm2 -g # Start the app using PM2 CMD ["pm2-runtime", "ecosystem.config.js"]