Shinhati2023 commited on
Commit
eabd011
·
verified ·
1 Parent(s): 6cf19d0

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +25 -43
start.sh CHANGED
@@ -1,47 +1,29 @@
1
- # 1. Use an NVIDIA base image to ensure GPU drivers are available
2
- # (Even if running on CPU-only for now, this prepares for upgrade)
3
- FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
4
 
5
- # 2. Prevent interactive prompts during build
6
- ENV DEBIAN_FRONTEND=noninteractive
 
 
7
 
8
- # 3. Install dependencies for Chromium and KasmVNC
9
- RUN apt-get update && apt-get install -y \
10
- wget \
11
- xvfb \
12
- libgbm1 \
13
- libgtk-3-0 \
14
- libnss3 \
15
- libasound2 \
16
- python3 \
17
- dbus-x11 \
18
- # Install FFMPEG for video processing capabilities
19
- ffmpeg \
20
- && rm -rf /var/lib/apt/lists/*
21
 
22
- # 4. Install KasmVNC (The secret sauce for video quality)
23
- RUN wget https://github.com/kasmtech/KasmVNC/releases/download/v1.1.0/kasmvncserver_focal_1.1.0_amd64.deb && \
24
- apt-get install -y ./kasmvncserver_*.deb && \
25
- rm kasmvncserver_*.deb
26
 
27
- # 5. COPY YOUR CUSTOM CHROMIUM BUILD
28
- # You must copy the custom binary we discussed to get H.264/HEVC support.
29
- # Assuming your build is in a local folder named 'chrome-linux'
30
- COPY ./chrome-linux /opt/chromium
31
- RUN chmod +x /opt/chromium/chrome
32
-
33
- # 6. Set up a user (Hugging Face prefers non-root users usually, but for X11 root is easier to debug initially.
34
- # Let's create a standard user 'user' with ID 1000)
35
- RUN useradd -m -u 1000 user
36
- USER user
37
- ENV HOME=/home/user
38
- WORKDIR $HOME
39
-
40
- # 7. Configure Chromium Flags for Docker
41
- # --no-sandbox is required in Docker
42
- # --disable-dev-shm-usage prevents crashing on low memory
43
- ENV CHROME_OPTS="--no-sandbox --disable-dev-shm-usage --start-maximized --user-data-dir=/data"
44
-
45
- # 8. Start Script
46
- COPY start.sh /start.sh
47
- CMD ["/bin/bash", "/start.sh"]
 
1
+ #!/bin/bash
 
 
2
 
3
+ # 1. Start the Virtual Display (Fake Screen)
4
+ export DISPLAY=:1
5
+ Xvfb :1 -screen 0 1920x1080x24 &
6
+ sleep 2
7
 
8
+ # 2. Start KasmVNC (The Streaming Server)
9
+ # This puts the video stream on port 7860
10
+ vncserver -port 7860 \
11
+ -httpd /usr/share/kasmvnc/www \
12
+ -sslOnly 0 \
13
+ -depth 24 \
14
+ -geometry 1920x1080 \
15
+ -fg &
 
 
 
 
 
16
 
17
+ # 3. Launch Chromium
18
+ # We point to the custom build you copied earlier
19
+ CHROME_BIN="/opt/chromium/chrome"
 
20
 
21
+ $CHROME_BIN \
22
+ --no-sandbox \
23
+ --disable-dev-shm-usage \
24
+ --start-maximized \
25
+ --user-data-dir=/home/user/data \
26
+ --enable-gpu \
27
+ --enable-unsafe-webgpu \
28
+ --ignore-gpu-blocklist \
29
+ https://huggingface.co