Shinhati2023 commited on
Commit
bfff9f3
·
verified ·
1 Parent(s): 5263c12

Create dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +47 -0
dockerfile ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]