virtualVS / Dockerfile
Pepguy's picture
Update Dockerfile
679f542 verified
FROM ubuntu:22.04
# Prevent interactive prompts during apt installations
ENV DEBIAN_FRONTEND=noninteractive
# 1. Install base utilities as root
RUN apt-get update && apt-get install -y \
curl wget git jq unzip build-essential \
python3 python3-pip \
&& rm -rf /var/lib/apt/lists/*
# 2. Install VS Code Server (code-server) as root
RUN curl -fsSL https://code-server.dev/install.sh | sh
# 3. INSTALL NODE.JS (v20) via NodeSource
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# 4. Create the Hugging Face user (UID 1000)
RUN useradd -m -u 1000 user
# 5. Set up environment variables
ENV HOME=/home/user
ENV PATH="/home/user/.local/bin:/home/user/.cargo/bin:/home/user/.bun/bin:$PATH"
# 6. Transfer ownership of the home directory from root to user
RUN chown -R user:user /home/user
# 7. Switch to the non-root user
USER user
WORKDIR $HOME
# 8. Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# 9. Install Bun
RUN curl -fsSL https://bun.sh/install | bash
# Expose port
EXPOSE 7860
# Start VS Code Server
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "--disable-telemetry"]