Spaces:
Paused
Paused
File size: 2,609 Bytes
9614102 599252b 9614102 e902618 9614102 599252b 9614102 599252b 9614102 599252b 9614102 855a7a1 9614102 e902618 9614102 599252b e902618 9614102 599252b 9614102 599252b 9614102 599252b | 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 | # ============================================================
# Hugging Face Space — Linux Desktop (XFCE) via noVNC
# Base: Ubuntu 24.04 + XFCE4 + Xvnc direct + noVNC
# Access: http://your-space.hf.space (port 7860)
# ============================================================
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/home/georgesnoe
ENV DISPLAY=:1
# ── System dependencies ──────────────────────────────────────
RUN apt-get update && apt-get install -y \
# Desktop environment
xfce4 \
xfce4-terminal \
xfce4-taskmanager \
xfce4-screenshooter \
thunar \
# VNC (Xvnc binary is in tigervnc-standalone-server)
tigervnc-standalone-server \
tigervnc-common \
# noVNC
novnc \
websockify \
# Browser
firefox \
# Utilities
wget \
curl \
git \
unzip \
sudo \
dbus-x11 \
xfonts-base \
xfonts-100dpi \
xfonts-75dpi \
fonts-liberation \
fonts-dejavu-core \
&& curl -fsSL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb \
-o /tmp/cloudflared.deb \
&& dpkg -i /tmp/cloudflared.deb \
&& rm /tmp/cloudflared.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# ── Create non-root user ──────────────────────────────────────
RUN useradd -m -s /bin/bash georgesnoe \
&& echo "georgesnoe:georgesnoe" | chpasswd \
&& usermod -aG sudo georgesnoe \
&& echo "georgesnoe ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# ── VNC dirs & xstartup ───────────────────────────────────────
RUN mkdir -p /home/georgesnoe/.vnc
COPY xstartup /home/georgesnoe/.vnc/xstartup
RUN chmod +x /home/georgesnoe/.vnc/xstartup \
&& chown -R georgesnoe:georgesnoe /home/georgesnoe/.vnc
# ── noVNC symlink ─────────────────────────────────────────────
RUN ln -sf /usr/share/novnc/vnc.html /usr/share/novnc/index.html
# ── Entrypoint ────────────────────────────────────────────────
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# ── Expose noVNC port (HF requires 7860) ──────────────────────
EXPOSE 7860
CMD ["/entrypoint.sh"] |