# 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", "."]