File size: 1,403 Bytes
16772e9
b04e5e3
16772e9
8a41dce
 
265b5f1
 
8a41dce
 
4aab618
 
 
36acdf5
16772e9
 
 
 
 
 
4aab618
 
 
 
 
 
 
 
 
 
36acdf5
265b5f1
b04e5e3
16772e9
265b5f1
 
 
 
 
b04e5e3
16772e9
265b5f1
 
b04e5e3
16772e9
 
 
 
 
 
 
 
 
 
 
265b5f1
16772e9
b04e5e3
265b5f1
16772e9
 
265b5f1
b04e5e3
4aab618
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
FROM python:3.11-slim-bookworm

# 1. Install System Dependencies
# Added 'fluxbox' (Window Manager) - CRITICAL for browser rendering
# Added 'xdotool' for input simulation/wake-up
RUN apt-get update && apt-get install -y \
    xvfb \
    fluxbox \
    xdotool \
    wget \
    curl \
    gnupg \
    procps \
    libx11-6 \
    libxtst6 \
    libxext6 \
    libxrender1 \
    libxi6 \
    # Opera/Chrome Dependencies
    libnss3 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libcups2 \
    libdrm2 \
    libgbm1 \
    libasound2 \
    libpangocairo-1.0-0 \
    libgtk-3-0 \
    fonts-liberation \
    xdg-utils \
    && rm -rf /var/lib/apt/lists/*

# 2. Install Opera Browser
RUN curl -fsSL https://deb.opera.com/archive.key | gpg --dearmor -o /usr/share/keyrings/opera-browser-keyring.gpg && \
    echo "deb [signed-by=/usr/share/keyrings/opera-browser-keyring.gpg] https://deb.opera.com/opera-stable/ stable non-free" \
    | tee /etc/apt/sources.list.d/opera-stable.list && \
    apt-get update && \
    apt-get install -y opera-stable

# 3. Setup User
RUN useradd -m -u 1000 user
WORKDIR /home/user/app

# 4. Install Python Libraries
RUN pip3 install --no-cache-dir \
    aiortc \
    aiohttp \
    mss \
    numpy \
    pillow \
    python-xlib \
    uvloop

# 5. Finalize Setup
COPY --chown=user:user . .
USER user

ENV DISPLAY=:99
ENV PYTHONUNBUFFERED=1

EXPOSE 7860

CMD ["python3", "app.py"]