FROM python:3.9 USER root # Install desktop environment, vnc, browser and tools RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ xfce4 \ xfce4-terminal \ xfce4-goodies \ novnc \ websockify \ x11vnc \ xvfb \ dbus-x11 \ firefox-esr \ curl \ wget \ procps \ net-tools \ ca-certificates \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Auto-redirect to vnc.html with autoconnect and scaling RUN echo 'Redirecting to desktop...' > /usr/share/novnc/index.html # Setup Hugging Face non-root user 'user' RUN id -u user &>/dev/null || useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ DISPLAY=:1 WORKDIR $HOME EXPOSE 7860 COPY --chown=user:user start.sh /home/user/start.sh RUN chmod +x /home/user/start.sh CMD ["/home/user/start.sh"]