|
| 1 | +# docker build -f Dockerfile.base -t roo-code-benchmark-base .. |
| 2 | +# docker build -f Dockerfile -t roo-code-benchmark .. |
| 3 | +# docker run -d -it -p 3000:3000 -v /tmp/benchmarks.db:/tmp/benchmarks.db roo-code-benchmark |
| 4 | +# docker exec -it $(docker ps --filter "ancestor=roo-code-benchmark" -q) /bin/bash |
| 5 | + |
| 6 | +FROM ubuntu:latest |
| 7 | + |
| 8 | +# Install dependencies |
| 9 | +RUN apt update && apt install -y sudo curl git vim jq |
| 10 | + |
| 11 | +# Create a `vscode` user |
| 12 | +RUN useradd -m vscode -s /bin/bash && \ |
| 13 | + echo "vscode ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/vscode && \ |
| 14 | + chmod 0440 /etc/sudoers.d/vscode |
| 15 | + |
| 16 | +# Install VS Code |
| 17 | +# https://code.visualstudio.com/docs/setup/linux |
| 18 | +RUN apt install -y wget gpg apt-transport-https |
| 19 | +RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg |
| 20 | +RUN install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg |
| 21 | +RUN echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | tee /etc/apt/sources.list.d/vscode.list > /dev/null |
| 22 | +RUN rm -f packages.microsoft.gpg |
| 23 | +RUN apt update && apt install -y code |
| 24 | + |
| 25 | +# Install Xvfb |
| 26 | +RUN apt install -y xvfb |
| 27 | + |
| 28 | +# [cpp] Install cmake 3.28.3 |
| 29 | +RUN apt install -y cmake |
| 30 | + |
| 31 | +# [go] Install Go 1.22.2 |
| 32 | +RUN apt install -y golang-go |
| 33 | + |
| 34 | +# [java] Install Java 21 |
| 35 | +RUN apt install -y default-jre |
| 36 | + |
| 37 | +# [javascript] Install Node.js v18.20.6 |
| 38 | +RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - |
| 39 | +RUN apt update && apt install -y nodejs |
| 40 | +RUN npm install -g corepack@latest |
| 41 | + |
| 42 | +# [python] Install Python 3.12.3 and uv 0.6.6 |
| 43 | +RUN apt install -y python3 python3-venv python3-dev python3-pip |
| 44 | + |
| 45 | +# [rust] Install Rust 1.85 |
| 46 | +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y |
| 47 | +RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc |
| 48 | + |
| 49 | +WORKDIR /home/vscode |
| 50 | +USER vscode |
| 51 | + |
| 52 | +# Enable corepack and install pnpm for the vscode user |
| 53 | +RUN corepack enable |
| 54 | +RUN yes y | pnpm --version |
| 55 | + |
| 56 | +COPY benchmark/entrypoint.sh /usr/local/bin/entrypoint.sh |
| 57 | + |
| 58 | +# Copy and build dependencies |
| 59 | +COPY --chown=vscode:vscode package*.json /home/vscode/repo/ |
| 60 | +COPY --chown=vscode:vscode webview-ui/package*.json /home/vscode/repo/webview-ui/ |
| 61 | +COPY --chown=vscode:vscode e2e/package*.json /home/vscode/repo/e2e/ |
| 62 | +COPY --chown=vscode:vscode benchmark/package*.json /home/vscode/repo/benchmark/ |
| 63 | +WORKDIR /home/vscode/repo |
| 64 | +RUN npm run install:all |
| 65 | + |
| 66 | +# Copy and build benchmark runner |
| 67 | +COPY --chown=vscode:vscode . /home/vscode/repo |
| 68 | +WORKDIR /home/vscode/repo/benchmark |
| 69 | +RUN npm run build |
| 70 | + |
| 71 | +# Copy exercises |
| 72 | +WORKDIR /home/vscode |
| 73 | +RUN git clone https://github.com/cte/Roo-Code-Benchmark.git exercises |
| 74 | + |
| 75 | +# Prepare exercises |
| 76 | +WORKDIR /home/vscode/exercises/python |
| 77 | +RUN curl -LsSf https://astral.sh/uv/install.sh | sh |
| 78 | +RUN /home/vscode/.local/bin/uv sync |
| 79 | + |
| 80 | +# Build web-ui |
| 81 | +WORKDIR /home/vscode/exercises/web-ui |
| 82 | +RUN echo "DB_FILE_NAME=file:/tmp/benchmarks.db" > .env |
| 83 | +RUN pnpm install |
| 84 | +RUN npx drizzle-kit push |
| 85 | + |
| 86 | +# Run web-ui |
| 87 | +EXPOSE 3000 |
| 88 | +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
| 89 | +CMD ["/usr/bin/pnpm", "dev"] |
0 commit comments