FROM debian:bookworm-slim ENV DEBIAN_FRONTEND=noninteractive ENV LANG=zh_CN.UTF-8 ENV LANGUAGE=zh_CN:zh ENV LC_ALL=zh_CN.UTF-8 RUN apt-get update && apt-get install -y --no-install-recommends \ sudo wget curl git nano htop procps net-tools iputils-ping \ xfce4 xfce4-terminal xfce4-goodies dbus-x11 \ tigervnc-standalone-server tigervnc-common tigervnc-tools \ novnc python3-websockify \ locales fonts-wqy-zenhei fcitx fcitx-pinyin fcitx-googlepinyin \ fcitx-frontend-gtk3 fcitx-frontend-qt5 \ firefox-esr chromium thunar mousepad galculator \ && rm -rf /var/lib/apt/lists/* RUN sed -i 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen && locale-gen # 不再创建用户,直接使用 HF Spaces 运行时的 UID 1000 RUN mkdir -p /home/user/.vnc && \ echo "${VNC_PWD:-password}" | vncpasswd -f > /home/user/.vnc/passwd && \ chmod 600 /home/user/.vnc/passwd RUN cp -r /usr/share/novnc /home/user/novnc RUN echo 'export GTK_IM_MODULE=fcitx' >> /home/user/.bashrc && \ echo 'export QT_IM_MODULE=fcitx' >> /home/user/.bashrc && \ echo 'export XMODIFIERS=@im=fcitx' >> /home/user/.bashrc WORKDIR /home/user EXPOSE 7860 COPY start.sh /home/user/start.sh RUN chmod +x /home/user/start.sh CMD ["/home/user/start.sh"]