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"]