File size: 2,212 Bytes
0e46f1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30821ad
0e46f1f
30821ad
0e46f1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0cf901b
0e46f1f
 
 
 
 
 
 
 
 
 
 
 
 
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
# ╔══════════════════════════════════════════════════════════╗
# β•‘  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"]