| FROM ubuntu:22.04 |
|
|
| LABEL description="Code Server + Stealth Browser Β· HF Spaces" |
|
|
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV HOME=/root |
| ENV SHELL=/bin/bash |
| ENV LANG=en_US.UTF-8 |
| ENV LC_ALL=en_US.UTF-8 |
| ENV CS_EXTENSIONS_DIR=/root/.local/share/code-server/extensions |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 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 xz-utils bzip2 \ |
| ca-certificates gnupg openssh-client ripgrep procps \ |
| nginx \ |
| && locale-gen en_US.UTF-8 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -fsSL "https://nodejs.org/dist/v20.19.0/node-v20.19.0-linux-x64.tar.xz" \ |
| -o /tmp/node.tar.xz \ |
| && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \ |
| && rm /tmp/node.tar.xz \ |
| && npm install -g yarn pnpm |
|
|
| |
| |
| RUN curl -fsSL https://code-server.dev/install.sh | sh \ |
| && rm -rf /tmp/code-server* |
|
|
| |
| RUN pip3 install --no-cache-dir \ |
| fastapi "uvicorn[standard]" \ |
| playwright "playwright-stealth==1.0.6" \ |
| ipykernel requests httpx \ |
| numpy pandas black isort pylint \ |
| huggingface_hub |
|
|
| |
| RUN playwright install chromium --with-deps |
|
|
| |
| 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" |
|
|
| |
| RUN mkdir -p /app/static |
| COPY browser_server.py /app/browser_server.py |
| COPY static/browser.html /app/static/browser.html |
| COPY nginx.conf /etc/nginx/nginx.conf |
| COPY start.sh /start.sh |
| RUN chmod +x /start.sh |
|
|
| WORKDIR /root |
| EXPOSE 7860 |
| CMD ["/start.sh"] |