File size: 3,780 Bytes
4ca5d81
 
 
 
 
 
 
 
 
 
892a9e9
 
 
4ca5d81
 
 
 
 
 
 
 
 
 
 
 
892a9e9
4ca5d81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
892a9e9
 
 
 
 
 
 
 
 
 
 
4ca5d81
 
 
 
892a9e9
4ca5d81
 
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM ubuntu:22.04

LABEL description="Code Server Β· HF Spaces Β· Full Dev Environment"

ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/root
ENV SHELL=/bin/bash
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

# Extensions live here β€” local, not on bucket (S3 FUSE can't do atomic renames)
ENV CS_EXTENSIONS_DIR=/root/.local/share/code-server/extensions

# ── Base system ────────────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y \
    curl wget git git-lfs \
    vim nano htop tree watch \
    python3 python3-pip python3-venv python3-dev \
    build-essential pkg-config cmake \
    sudo locales \
    jq unzip zip tar gzip \
    ca-certificates gnupg lsb-release \
    openssh-client \
    ripgrep \
    procps \
    fuse3 \
    && locale-gen en_US.UTF-8 \
    && rm -rf /var/lib/apt/lists/*

# ── Node.js 20 LTS ─────────────────────────────────────────────────────────
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs \
    && npm install -g yarn pnpm \
    && rm -rf /var/lib/apt/lists/*

# ── GitHub CLI ─────────────────────────────────────────────────────────────
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
      | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
    && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
    && echo "deb [arch=$(dpkg --print-architecture) \
      signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] \
      https://cli.github.com/packages stable main" \
      | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
    && apt-get update && apt-get install -y gh \
    && rm -rf /var/lib/apt/lists/*

# ── code-server ────────────────────────────────────────────────────────────
RUN curl -fsSL https://code-server.dev/install.sh | sh \
    && rm -rf /tmp/code-server*

# ── Python packages ────────────────────────────────────────────────────────
RUN pip3 install --no-cache-dir \
    ipykernel \
    requests httpx \
    numpy pandas \
    black isort pylint \
    huggingface_hub

# ── Install extensions at BUILD time into local image layer ───────────────
# This avoids S3 FUSE atomic-rename issues completely
RUN mkdir -p "$CS_EXTENSIONS_DIR" && \
    code-server --install-extension ms-python.python          --extensions-dir "$CS_EXTENSIONS_DIR" && \
    code-server --install-extension ms-toolsai.jupyter        --extensions-dir "$CS_EXTENSIONS_DIR" && \
    code-server --install-extension esbenp.prettier-vscode    --extensions-dir "$CS_EXTENSIONS_DIR" && \
    code-server --install-extension eamodio.gitlens           --extensions-dir "$CS_EXTENSIONS_DIR" && \
    code-server --install-extension PKief.material-icon-theme --extensions-dir "$CS_EXTENSIONS_DIR" && \
    code-server --install-extension formulahendry.code-runner --extensions-dir "$CS_EXTENSIONS_DIR" && \
    code-server --install-extension christian-kohler.path-intellisense --extensions-dir "$CS_EXTENSIONS_DIR" && \
    echo "βœ… All extensions baked into image"

COPY start.sh /start.sh
RUN chmod +x /start.sh

WORKDIR /root
EXPOSE 7860
CMD ["/start.sh"]