Spaces:
Paused
Paused
File size: 1,377 Bytes
9fedfb0 ec45b84 edda91f 9fedfb0 ec45b84 9fedfb0 ec45b84 9fedfb0 ec45b84 edda91f | 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 | # Use a standard, full-featured base image that's great for development tools
FROM node:20
# --- Install Dependencies (as root) ---
# We remove python3-uv from this list as it's not available in the apt repo
RUN apt-get update && apt-get install -y \
git \
curl \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# --- Install uv (as root) and move it to a global location ---
# This is the correct and reliable way to install uv.
# 1. Download and run the official installer script.
# 2. Move the compiled 'uv' program to /usr/local/bin.
# This makes it available to ALL users, including the 'node' user.
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.cargo/bin/uv /usr/local/bin/uv
# --- Install Gemini CLI (as root) ---
RUN npm install -g @google/gemini-cli
# --- Install code-server (as root) ---
RUN curl -fsSL https://code-server.dev/install.sh | sh
# --- Prepare the user's workspace (as root) ---
RUN mkdir -p /home/node && chown -R node:node /home/node
# Set the working directory for the user
WORKDIR /home/node
# Now, permanently switch to the non-root user
USER node
# Expose the port that code-server will run on. Hugging Face will detect this.
EXPOSE 7860
# --- Final Command (as the 'node' user) ---
# Start code-server directly.
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."] |