# 1. Base Image FROM debian:11-slim ENV DEBIAN_FRONTEND=noninteractive ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # 2. Install Node and VS Code RUN apt-get update && apt-get install -y curl git sudo && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ curl -fsSL https://code-server.dev/install.sh | sh && \ rm -rf /var/lib/apt/lists/* # 3. Setup User RUN useradd -m -u 1000 user WORKDIR $HOME/app # 4. PRE-CREATE CONFIG DIR AND COPY YOUR FILE # We create the folder first, then copy the file into it RUN mkdir -p $HOME/.config/code-server COPY --chown=user:user config.yaml $HOME/.config/code-server/config.yaml # 5. Fix permissions for the entire home directory RUN chown -R user:user $HOME USER user # 6. Start VS Code using that config file CMD ["code-server", "--config", "/home/user/.config/code-server/config.yaml", "."]