mirror of
https://github.com/tanjiro517/cf-bypass-fast.git
synced 2025-12-05 15:08:02 +01:00
Update Dockerfile
This commit is contained in:
46
Dockerfile
46
Dockerfile
@@ -1,17 +1,45 @@
|
|||||||
FROM node:18-slim
|
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
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
# Copy package files
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install NPM dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy application code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install PM2 globally
|
||||||
|
RUN npm install -g pm2
|
||||||
|
|
||||||
|
# Expose port 8080 (for Cloudflare solver)
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Default to production mode
|
# Start PM2 with production mode (npm start equivalent)
|
||||||
CMD ["npm", "start"]
|
CMD pm2 start index.js --name "cf-bypass" --no-daemon && pm2 startup && pm2 save
|
||||||
|
|
||||||
# For development mode, override with: docker run -e NODE_ENV=development ...
|
|
||||||
CMD ["npm", "run", "dev"]
|
|
||||||
|
|
||||||
#ABHI
|
|
||||||
|
|||||||
Reference in New Issue
Block a user