File size: 2,369 Bytes
b1044a6
8b818ce
b1044a6
 
 
 
 
 
7273978
b1044a6
 
 
 
 
 
 
 
 
 
 
 
 
 
4f33572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1044a6
 
 
 
 
7273978
4f33572
 
 
 
 
 
 
 
 
 
6e48cb5
4f33572
4675f81
 
 
 
 
 
 
8b818ce
 
 
 
 
 
 
b1044a6
 
8b818ce
 
 
4f33572
 
 
8b818ce
 
 
 
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FROM python:3.11-slim-bullseye

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    xvfb \
    x11-utils \
    x11-xserver-utils \
    xdotool \
    matchbox-window-manager \
    libx11-dev \
    libxrandr2 \
    libxtst6 \
    libavcodec-dev \
    libavdevice-dev \
    libavfilter-dev \
    libavformat-dev \
    libavutil-dev \
    libswscale-dev \
    libswresample-dev \
    libvpx-dev \
    libopus-dev \
    libffi-dev \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxi6 \
    libnss3 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libcups2 \
    libdrm2 \
    libgbm1 \
    libasound2 \
    libpangocairo-1.0-0 \
    libgtk-3-0 \
    fonts-liberation \
    fonts-noto-color-emoji \
    wget \
    curl \
    gnupg \
    procps \
    && rm -rf /var/lib/apt/lists/*

RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    apt-get update && \
    apt-get install -y ./google-chrome-stable_current_amd64.deb && \
    rm google-chrome-stable_current_amd64.deb && \
    rm -rf /var/lib/apt/lists/*

RUN mv /usr/bin/google-chrome /usr/bin/google-chrome-orig && \
    echo '#!/bin/bash\n/usr/bin/google-chrome-orig --no-sandbox --start-maximized --no-first-run --no-default-browser-check "$@"' > /usr/bin/google-chrome && \
    chmod +x /usr/bin/google-chrome

RUN update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/google-chrome 9999

RUN mkdir -p /etc/apt/keyrings && \
    curl -fsSL https://us-central1-apt.pkg.dev/doc/repo-signing-key.gpg | gpg --dearmor --yes -o /etc/apt/keyrings/antigravity-repo-key.gpg && \
    echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev/ antigravity-debian main" | tee /etc/apt/sources.list.d/antigravity.list > /dev/null && \
    apt-get update && \
    apt-get install -y antigravity && \
    rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

COPY --chown=user:user app.py .

ENV DISPLAY=:99 \
    RESOLUTION=1280x720 \
    BROWSER=/usr/bin/google-chrome

EXPOSE 7860

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