# Use Node.js 23 FROM node:23-bookworm # Install system dependencies RUN apt-get update && apt-get install -y \ git \ python3 \ build-essential \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # Set environment variables ENV NODE_ENV=production ENV PORT=7860 ENV MONGO_URI=${MONGO_URI} # Create app directory WORKDIR /app # Install Python 2 for node-gyp RUN ln -s /usr/bin/python3 /usr/bin/python # Copy package files COPY package*.json ./ # Install dependencies RUN npm install --omit=dev # Copy app source COPY . . # Create persistent storage RUN mkdir -p /persistent/storage && \ chmod -R 777 /persistent && \ mkdir -p /tmp/users && \ chmod -R 777 /tmp # Health check HEALTHCHECK --interval=30s --timeout=3s \ CMD curl -f http://localhost:${PORT} || exit 1 # Expose port EXPOSE ${PORT} # Start application CMD ["node", "server.js"]