forked from DrakeHooks/CasinoClaim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (43 loc) · 1.89 KB
/
Dockerfile
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
# Use Ubuntu 22.04 as the base image
FROM ubuntu:latest
# Install necessary packages
RUN apt-get update && apt-get install -y \
xvfb \
x11vnc \
fluxbox \
wget \
unzip \
gnupg2 \
software-properties-common \
apt-utils \
ca-certificates \
python3 \
python3-venv \
python3-pip \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Install Chrome
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' && \
apt-get update && apt-get install -y google-chrome-stable && \
rm -rf /var/lib/apt/lists/*
# Set the working directory to the root of the project
WORKDIR /app
# Copy the .crx file to a temporary directory
COPY ./CAPTCHA-Solver-auto-hCAPTCHA-reCAPTCHA-freely-Chrome-Web-Store.crx /temp/CAPTCHA-Solver-auto-hCAPTCHA-reCAPTCHA-freely-Chrome-Web-Store.crx
# Copy the google-chrome directory to a temporary directory
COPY ./google-chrome /temp/google-chrome
# Copy the entire project to /app in the container
COPY . /app
# Create virtual environment and install Python dependencies
RUN python3 -m venv /venv && \
/venv/bin/pip install --no-cache-dir -r /app/requirements.txt
# Install common utilities
RUN apt-get update && apt-get install -y xdg-utils ca-certificates
# Ensure the lock file is removed on every container start
RUN echo '#!/bin/bash\nrm -f /tmp/.X99-lock\nexec "$@"' > /usr/local/bin/docker-entrypoint.sh && chmod +x /usr/local/bin/docker-entrypoint.sh
# Set environment variables
ENV PATH="/venv/bin:$PATH"
ENV DISPLAY=:99
# Start Xvfb, fluxbox, and x11vnc, ensuring no lock conflicts
CMD ["/usr/local/bin/docker-entrypoint.sh", "bash", "-c", "Xvfb :99 -screen 0 1920x1080x24 & fluxbox & x11vnc -forever -usepw -create -display :99 & /venv/bin/python /app/main.py"]