FROM node:23-bookworm # Install system dependencies RUN apt-get update && apt-get install -y \ python3 \ python3-pip \ git \ build-essential \ python-is-python3 \ && rm -rf /var/lib/apt/lists/* # Install yarn and pm2 globally RUN npm install -g yarn pm2 # Set environment variables ENV PATH="${PATH}:/usr/local/bin" ENV PM2_HOME=/tmp/.pm2 ENV NPM_CONFIG_CACHE=/tmp/npm_cache ENV YARN_CACHE_FOLDER=/tmp/yarn_cache ENV NODE_ENV=production ENV NODE_OPTIONS=--max-old-space-size=512 # Create app directory WORKDIR /app # Copy requirements and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the files COPY . . # Start script CMD ["python3", "app.py"]