Roo-Code/.devcontainer/Dockerfile
Roo Code 50179a5f69 fix: improve devcontainer configuration based on review
- Fix PATH handling to avoid host PATH injection
- Configure pnpm store directory to use mounted volume
- Remove redundant node_modules volume mounts
- Remove WORKDIR directive to use Dev Container defaults
2025-11-02 11:33:33 +00:00

37 lines
No EOL
1,021 B
Docker

# Use the official Node.js image as base
FROM node:20.19.2-bookworm-slim
# Install basic development tools
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
ca-certificates \
gnupg \
lsb-release \
# Clean up apt cache to reduce image size
&& rm -rf /var/lib/apt/lists/*
# Install pnpm globally with the exact version from package.json
RUN corepack enable && corepack prepare pnpm@10.8.1 --activate
# Set pnpm store directory for better caching
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Create a non-root user for development
ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Ensure the node user has the correct UID/GID
RUN groupmod --gid $USER_GID $USERNAME \
&& usermod --uid $USER_UID --gid $USER_GID $USERNAME \
&& chown -R $USER_UID:$USER_GID /home/$USERNAME
# Create pnpm directories with correct permissions
RUN mkdir -p /pnpm /workspace \
&& chown -R $USERNAME:$USERNAME /pnpm /workspace
# Switch to non-root user
USER $USERNAME