# Use a standard, full-featured base image that's great for development tools FROM node:20 # --- Install Dependencies (as root) --- RUN apt-get update && apt-get install -y \ git \ curl \ && rm -rf /var/lib/apt/lists/* # --- 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) --- # Create the home directory and give the 'node' user ownership 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 EXPOSE 7860 # --- Final Command (as the 'node' user) --- # Start code-server directly. It will run as the 'node' user in the '/home/node' directory. CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "."]