File size: 2,005 Bytes
4fdd2f6
 
7b93e32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4fdd2f6
7b93e32
4fdd2f6
7b93e32
 
4fdd2f6
 
 
e86cb1b
 
4fdd2f6
 
e86cb1b
 
 
 
 
 
 
4fdd2f6
 
 
e86cb1b
4fdd2f6
 
1c9856e
4fdd2f6
 
 
 
 
 
 
e86cb1b
7b93e32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM node:20-slim

USER root

# Instal dependensi sistem secara mendalam
RUN apt-get update && apt-get install -y --no-install-recommends \
    wget \
    gnupg \
    ca-certificates \
    xvfb \
    xauth \
    x11-apps \
    libnss3 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libcups2 \
    libdrm2 \
    libxcomposite1 \
    libxdamage1 \
    libxrandr2 \
    libgbm1 \
    libasound2 \
    libxss1 \
    libpangocairo-1.0-0 \
    libgtk-3-0 \
    libcairo2 \
    libjpeg62-turbo \
    libpango1.0-0 \
    libgif7 \
    librsvg2-2 \
    && wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
    && apt-get install -y ./google-chrome-stable_current_amd64.deb \
    && rm google-chrome-stable_current_amd64.deb \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# --- BAGIAN OTOMATISASI FOLDER & FILE ---
# 1. Membuat folder yang dibutuhkan
RUN mkdir -p /app/endpoints /app/cache && chmod -R 777 /app/cache

# 2. Membuat file dummy agar 'require' di index.js tidak error
# Ini akan membuat file minimal yang valid secara sintaksis Node.js
RUN echo "module.exports = async (data, page) => ({ code: 200, message: 'Turnstile Dummy Active' });" > /app/endpoints/turnstile.js && \
    echo "module.exports = async (data, page) => ({ code: 200, message: 'Cloudflare Dummy Active' });" > /app/endpoints/cloudflare.js && \
    echo "module.exports = async (data) => ({ code: 200, message: 'Antibot Dummy Active' });" > /app/endpoints/antibot.js
# ----------------------------------------

COPY package*.json ./
RUN npm install --production

# Salin sisa file project (jika kamu punya file asli, ini akan menimpa file dummy di atas)
COPY . .

# Environment Variables
ENV PORT=7860
ENV DISPLAY=:99
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable

EXPOSE 7860

# Jalankan pembersihan lock file Xvfb sebelum start
CMD rm -f /tmp/.X99-lock && xvfb-run --server-args="-screen 0 1024x768x24" npm start