From cc967e92ce52732f9e810e221e808bdface70b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abhinai=20Reddy=E2=9B=94=EF=B8=8F?= <159715958+abhinai2244@users.noreply.github.com> Date: Tue, 7 Oct 2025 16:25:12 +0530 Subject: [PATCH] Update Dockerfile --- Dockerfile | 41 +++++++---------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index b54dd82..b67e704 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,45 +1,18 @@ -FROM ubuntu:22.04 - -# Install dependencies -RUN apt-get update && apt-get install -y \ - curl \ - wget \ - gnupg \ - xvfb \ - && rm -rf /var/lib/apt/lists/* - -# Install Node.js 22.x -RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ - && apt-get install -y nodejs - -# Install Google Chrome -RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ - && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \ - && apt-get update \ - && apt-get install -y google-chrome-stable \ - && rm -rf /var/lib/apt/lists/* - -# Set up Xvfb (virtual display) -RUN Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & -ENV DISPLAY=:99 +# Use official Node.js image +FROM node:20 # Set working directory WORKDIR /app -# Copy package files +# Copy package files and install dependencies COPY package*.json ./ - -# Install NPM dependencies RUN npm install -# Copy application code +# Copy the rest of the app COPY . . -# Install PM2 globally -RUN npm install -g pm2 - -# Expose port 8080 (for Cloudflare solver) +# Expose port (adjust if your app uses a different one) EXPOSE 8080 -# Start PM2 with production mode (npm start equivalent) -CMD pm2 start index.js --name "cf-bypass" --no-daemon && pm2 startup && pm2 save +# Default command (can be overridden) +CMD ["npm", "start"]