File size: 2,190 Bytes
fe03ff1
bfff9f3
 
efc6a71
bfff9f3
 
efc6a71
bfff9f3
 
b544842
49a7e84
b544842
bfff9f3
 
 
 
 
b544842
bfff9f3
b544842
bfff9f3
 
b544842
d93b13e
 
 
 
 
 
 
6e16d43
 
bfff9f3
 
6e16d43
efc6a71
 
6e16d43
 
 
 
 
 
 
bfff9f3
 
1defd94
fe03ff1
bfff9f3
49a7e84
bfff9f3
 
 
 
 
1defd94
e3d4397
 
 
49a7e84
 
d77bdf4
b544842
d93b13e
b544842
 
 
fe03ff1
b544842
bfff9f3
b544842
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
# Use NVIDIA CUDA base for GPU support
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04

# Set non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive

# 1. Install System Dependencies
RUN apt-get update && apt-get install -y \
    wget \
    curl \
    unzip \
    xz-utils \
    xvfb \
    libgbm1 \
    libgtk-3-0 \
    libnss3 \
    libasound2 \
    pulseaudio \
    python3 \
    python3-pip \
    dbus-x11 \
    ffmpeg \
    ca-certificates \
    ssl-cert \
    libswitch-perl \
    libyaml-tiny-perl \
    libhash-merge-simple-perl \
    liblist-moreutils-perl \
    libtry-tiny-perl \
    libdatetime-timezone-perl \
    # Add 'debconf-utils' to allow us to pre-seed answers
    debconf-utils \
    && rm -rf /var/lib/apt/lists/*

# 2. Install KasmVNC (THE NUCLEAR FIX)
RUN wget https://github.com/kasmtech/KasmVNC/releases/download/v1.3.1/kasmvncserver_jammy_1.3.1_amd64.deb

# --- PRE-SEEDING ANSWERS ---
# This block tells the system: "When kasmvncserver asks about 'daemon_user_write', answer 'false' (Option 2)"
RUN echo "kasmvncserver kasmvncserver/daemon_user_write boolean false" | debconf-set-selections && \
    echo "kasmvncserver kasmvncserver/default_user_write boolean false" | debconf-set-selections

# Now we install, and it should see the answer is already there.
RUN apt-get install -y ./kasmvncserver_*.deb || apt-get install -f -y && \
    rm kasmvncserver_*.deb

# 3. Install Python libraries
RUN pip3 install requests yt-dlp

# 4. Setup User
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user
WORKDIR $HOME

# 5. Download Chromium
RUN LAST_CHANGE=$(curl -sS https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media) && \
    echo "Downloading Chromium Build: $LAST_CHANGE" && \
    wget -q "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F${LAST_CHANGE}%2Fchrome-linux.zip?alt=media" -O chrome-linux.zip && \
    unzip -q chrome-linux.zip && \
    rm chrome-linux.zip && \
    chmod +x /home/user/chrome-linux/chrome

# 6. Prepare Start Script
COPY --chown=user start.sh /start.sh
RUN chmod +x /start.sh

# 7. Expose Port
EXPOSE 7860

CMD ["/start.sh"]