abc1181 commited on
Commit
486f8fb
·
verified ·
1 Parent(s): a88b4d0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +79 -0
Dockerfile ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ LABEL description="Code Server + Manus-style Browser · HF Spaces"
4
+
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+ ENV HOME=/root
7
+ ENV SHELL=/bin/bash
8
+ ENV LANG=en_US.UTF-8
9
+ ENV LC_ALL=en_US.UTF-8
10
+ ENV CS_EXTENSIONS_DIR=/root/.local/share/code-server/extensions
11
+
12
+ # ── Base system ────────────────────────────────────────────────────────────
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ curl wget git git-lfs \
15
+ vim nano htop tree watch \
16
+ python3 python3-pip python3-venv python3-dev \
17
+ build-essential pkg-config cmake \
18
+ sudo locales jq unzip zip tar gzip xz-utils bzip2 \
19
+ ca-certificates gnupg openssh-client ripgrep procps \
20
+ nginx \
21
+ && locale-gen en_US.UTF-8 \
22
+ && rm -rf /var/lib/apt/lists/*
23
+
24
+ # ── Node.js 20 LTS ─────────────────────────────────────────────────────────
25
+ RUN curl -fsSL "https://nodejs.org/dist/v20.19.0/node-v20.19.0-linux-x64.tar.xz" \
26
+ -o /tmp/node.tar.xz \
27
+ && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \
28
+ && rm /tmp/node.tar.xz \
29
+ && npm install -g yarn pnpm
30
+
31
+ # ── GitHub CLI ─────────────────────────────────────────────────────────────
32
+ RUN curl -fsSL \
33
+ "https://github.com/cli/cli/releases/latest/download/gh_2.67.0_linux_amd64.tar.gz" \
34
+ -o /tmp/gh.tar.gz \
35
+ && tar -xzf /tmp/gh.tar.gz -C /tmp \
36
+ && mv /tmp/gh_2.67.0_linux_amd64/bin/gh /usr/local/bin/gh \
37
+ && rm -rf /tmp/gh.tar.gz /tmp/gh_2.67.0_linux_amd64
38
+
39
+ # ── ttyd (web terminal) ────────────────────────────────────────────────────
40
+ RUN curl -fsSL \
41
+ "https://github.com/tsl0922/ttyd/releases/latest/download/ttyd.x86_64" \
42
+ -o /usr/local/bin/ttyd \
43
+ && chmod +x /usr/local/bin/ttyd
44
+
45
+ # ── code-server ────────────────────────────────────────────────────────────
46
+ RUN curl -fsSL https://code-server.dev/install.sh | sh \
47
+ && rm -rf /tmp/code-server*
48
+
49
+ # ── Python packages + Playwright ──────────────────────────────────────────
50
+ RUN pip3 install --no-cache-dir \
51
+ fastapi uvicorn[standard] playwright \
52
+ ipykernel requests httpx \
53
+ numpy pandas black isort pylint \
54
+ huggingface_hub
55
+
56
+ # ── Playwright Chromium + all system deps ─────────────────────────────────
57
+ RUN playwright install chromium --with-deps
58
+
59
+ # ── VS Code extensions baked in ───────────────────────────────────────────
60
+ RUN mkdir -p "$CS_EXTENSIONS_DIR" \
61
+ && code-server --install-extension ms-python.python --extensions-dir "$CS_EXTENSIONS_DIR" \
62
+ && code-server --install-extension ms-toolsai.jupyter --extensions-dir "$CS_EXTENSIONS_DIR" \
63
+ && code-server --install-extension esbenp.prettier-vscode --extensions-dir "$CS_EXTENSIONS_DIR" \
64
+ && code-server --install-extension eamodio.gitlens --extensions-dir "$CS_EXTENSIONS_DIR" \
65
+ && code-server --install-extension PKief.material-icon-theme --extensions-dir "$CS_EXTENSIONS_DIR" \
66
+ && code-server --install-extension formulahendry.code-runner --extensions-dir "$CS_EXTENSIONS_DIR" \
67
+ && code-server --install-extension christian-kohler.path-intellisense --extensions-dir "$CS_EXTENSIONS_DIR"
68
+
69
+ # ── App files ──────────────────────────────────────────────────────────────
70
+ RUN mkdir -p /app/static
71
+ COPY browser_server.py /app/browser_server.py
72
+ COPY static/browser.html /app/static/browser.html
73
+ COPY nginx.conf /etc/nginx/nginx.conf
74
+ COPY start.sh /start.sh
75
+ RUN chmod +x /start.sh
76
+
77
+ WORKDIR /root
78
+ EXPOSE 7860
79
+ CMD ["/start.sh"]