# ╔══════════════════════════════════════════════════════════╗ # ║ THE Z AI — Computer Mode Server ║ # ║ Hugging Face Spaces Dockerfile ║ # ║ Linux Desktop (Xvfb) + WebSocket Control API ║ # ╚══════════════════════════════════════════════════════════╝ FROM ubuntu:22.04 # ── Avoid interactive prompts ────────────────────────────── ENV DEBIAN_FRONTEND=noninteractive ENV DISPLAY=:1 ENV PYTHONUNBUFFERED=1 ENV PORT=7860 # ── System packages ──────────────────────────────────────── RUN apt-get update && apt-get install -y --no-install-recommends \ python3.11 python3-pip python3.11-dev \ python3-tk \ xvfb x11-utils xdotool \ xauth \ fluxbox \ scrot \ xclip xsel \ firefox \ nano vim curl wget git \ libgtk-3-0 libglib2.0-0 libx11-dev \ fonts-noto fonts-noto-cjk \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # ── Python alias ────────────────────────────────────────── RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 && \ ln -sf /usr/bin/python3.11 /usr/bin/python # ── Create app user (HuggingFace requirement: non-root) ─── RUN useradd -m -u 1000 zai WORKDIR /app COPY app.py requirements.txt /app/ RUN chown -R zai:zai /app # ── Python dependencies ──────────────────────────────────── RUN pip install --no-cache-dir -r /app/requirements.txt # ── Startup script ──────────────────────────────────────── COPY start.sh /start.sh RUN chmod +x /start.sh && chown zai:zai /start.sh USER zai EXPOSE 7860 CMD ["/start.sh"]