vish85521 commited on
Commit
7835d1e
·
verified ·
1 Parent(s): 0cd7337

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -7,16 +7,17 @@ RUN useradd -m -u 1000 user
7
  ENV HOME=/home/user
8
  ENV PATH=/home/user/.local/bin:$PATH
9
 
10
- # 2. Install desktop, VNC, web access, and dbus-x11 to silence XFCE warnings
11
  RUN apt-get update && apt-get install -y \
12
  xfce4 xfce4-goodies \
13
  x11vnc xvfb \
14
  novnc websockify \
15
  wget curl git \
16
- dbus-x11 \
17
  && apt-get clean && rm -rf /var/lib/apt/lists/*
18
 
19
  # 3. Bulletproof Health Check Fix
 
 
20
  RUN echo '<meta http-equiv="refresh" content="0; url=vnc.html">' > /usr/share/novnc/index.html
21
 
22
  WORKDIR $HOME
@@ -32,12 +33,12 @@ USER user
32
  # 6. Expose web port
33
  EXPOSE 7860
34
 
35
- # 7. Start everything with a DBus session to keep XFCE happy
36
  CMD bash -c "\
37
  Xvfb :0 -screen 0 1024x768x24 & \
38
  sleep 2 && \
39
  export DISPLAY=:0 && \
40
- dbus-launch startxfce4 & \
41
  x11vnc -display :0 -usepw -forever -rfbport 5900 & \
42
  websockify --web=/usr/share/novnc/ 7860 localhost:5900 \
43
  "
 
7
  ENV HOME=/home/user
8
  ENV PATH=/home/user/.local/bin:$PATH
9
 
10
+ # 2. Install desktop, VNC, and web access
11
  RUN apt-get update && apt-get install -y \
12
  xfce4 xfce4-goodies \
13
  x11vnc xvfb \
14
  novnc websockify \
15
  wget curl git \
 
16
  && apt-get clean && rm -rf /var/lib/apt/lists/*
17
 
18
  # 3. Bulletproof Health Check Fix
19
+ # We create a custom index.html that gives Hugging Face a "200 OK" health status,
20
+ # while instantly redirecting your browser to the actual VNC page.
21
  RUN echo '<meta http-equiv="refresh" content="0; url=vnc.html">' > /usr/share/novnc/index.html
22
 
23
  WORKDIR $HOME
 
33
  # 6. Expose web port
34
  EXPOSE 7860
35
 
36
+ # 7. Start everything (Removed the failing DPMS command)
37
  CMD bash -c "\
38
  Xvfb :0 -screen 0 1024x768x24 & \
39
  sleep 2 && \
40
  export DISPLAY=:0 && \
41
+ startxfce4 & \
42
  x11vnc -display :0 -usepw -forever -rfbport 5900 & \
43
  websockify --web=/usr/share/novnc/ 7860 localhost:5900 \
44
  "