THEZYZSTUDIO commited on
Commit
0e46f1f
Β·
verified Β·
1 Parent(s): 1389363

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -0
Dockerfile ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ╔══════════════════════════════════════════════════════════╗
2
+ # β•‘ THE Z AI β€” Computer Mode Server β•‘
3
+ # β•‘ Hugging Face Spaces Dockerfile β•‘
4
+ # β•‘ Linux Desktop (Xvfb) + WebSocket Control API β•‘
5
+ # β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
6
+
7
+ FROM ubuntu:22.04
8
+
9
+ # ── Avoid interactive prompts ──────────────────────────────
10
+ ENV DEBIAN_FRONTEND=noninteractive
11
+ ENV DISPLAY=:1
12
+ ENV PYTHONUNBUFFERED=1
13
+ ENV PORT=7860
14
+
15
+ # ── System packages ────────────────────────────────────────
16
+ RUN apt-get update && apt-get install -y --no-install-recommends \
17
+ python3.11 python3-pip python3.11-dev \
18
+ xvfb x11-utils xdotool \
19
+ fluxbox \
20
+ scrot \
21
+ xclip xsel \
22
+ firefox \
23
+ nano vim curl wget git \
24
+ libgtk-3-0 libglib2.0-0 libx11-dev \
25
+ fonts-noto fonts-noto-cjk \
26
+ ca-certificates \
27
+ && rm -rf /var/lib/apt/lists/*
28
+
29
+ # ── Python alias ──────────────────────────────────────────
30
+ RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 && \
31
+ ln -sf /usr/bin/python3.11 /usr/bin/python
32
+
33
+ # ── Create app user (HuggingFace requirement: non-root) ───
34
+ RUN useradd -m -u 1000 zai
35
+ WORKDIR /app
36
+ COPY server/ /app/
37
+ RUN chown -R zai:zai /app
38
+
39
+ # ── Python dependencies ────────────────────────────────────
40
+ RUN pip install --no-cache-dir -r /app/requirements.txt
41
+
42
+ # ── Startup script ────────────────────────────────────────
43
+ COPY start.sh /start.sh
44
+ RUN chmod +x /start.sh && chown zai:zai /start.sh
45
+
46
+ USER zai
47
+ EXPOSE 7860
48
+
49
+ CMD ["/start.sh"]