Spaces:
Runtime error
Runtime error
File size: 906 Bytes
030314c 038c2be 030314c 038c2be 030314c 038c2be 030314c 038c2be | 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 | # Use a stable Ubuntu base
FROM ubuntu:22.04
# Avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# 1. Install sudo, git, and basic build tools
RUN apt-get update && apt-get install -y \
sudo \
git \
curl \
wget \
build-essential \
python3 \
python3-pip \
unzip \
&& rm -rf /var/lib/apt/lists/*
# 2. Install code-server (VS Code Web)
RUN curl -fsSL https://code-server.dev/install.sh | sh
# 3. Create a user 'user' with ID 1000 (HF requirement)
RUN useradd -m -u 1000 user && \
echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# 4. Set environment variables
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME
# 5. Expose the port HF uses
EXPOSE 7860
# 6. Start code-server on the correct port with no password for ease of use
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."] |