abcd118q commited on
Commit
914865e
·
verified ·
1 Parent(s): 0d8091e

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +74 -0
Dockerfile ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ LABEL description="Code Server + Stealth 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
+ # ── code-server ────────────────────────────────────────────────────────────
40
+ RUN curl -fsSL https://code-server.dev/install.sh | sh \
41
+ && rm -rf /tmp/code-server*
42
+
43
+ # ── Python + Playwright + stealth ─────────────────────────────────────────
44
+ RUN pip3 install --no-cache-dir \
45
+ fastapi "uvicorn[standard]" \
46
+ playwright playwright-stealth \
47
+ ipykernel requests httpx \
48
+ numpy pandas black isort pylint \
49
+ huggingface_hub
50
+
51
+ # ── Playwright Chromium + system deps ─────────────────────────────────────
52
+ RUN playwright install chromium --with-deps
53
+
54
+ # ── VS Code extensions ─────────────────────────────────────────────────────
55
+ RUN mkdir -p "$CS_EXTENSIONS_DIR" \
56
+ && code-server --install-extension ms-python.python --extensions-dir "$CS_EXTENSIONS_DIR" \
57
+ && code-server --install-extension ms-toolsai.jupyter --extensions-dir "$CS_EXTENSIONS_DIR" \
58
+ && code-server --install-extension esbenp.prettier-vscode --extensions-dir "$CS_EXTENSIONS_DIR" \
59
+ && code-server --install-extension eamodio.gitlens --extensions-dir "$CS_EXTENSIONS_DIR" \
60
+ && code-server --install-extension PKief.material-icon-theme --extensions-dir "$CS_EXTENSIONS_DIR" \
61
+ && code-server --install-extension formulahendry.code-runner --extensions-dir "$CS_EXTENSIONS_DIR" \
62
+ && code-server --install-extension christian-kohler.path-intellisense --extensions-dir "$CS_EXTENSIONS_DIR"
63
+
64
+ # ── App files ──────────────────────────────────────────────────────────────
65
+ RUN mkdir -p /app/static
66
+ COPY browser_server.py /app/browser_server.py
67
+ COPY static/browser.html /app/static/browser.html
68
+ COPY nginx.conf /etc/nginx/nginx.conf
69
+ COPY start.sh /start.sh
70
+ RUN chmod +x /start.sh
71
+
72
+ WORKDIR /root
73
+ EXPOSE 7860
74
+ CMD ["/start.sh"]