Spaces:
Running
Running
| FROM ubuntu:22.04 | |
| # ββ System dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| curl \ | |
| wget \ | |
| build-essential \ | |
| libssl-dev \ | |
| libffi-dev \ | |
| python3.11 \ | |
| python3.11-dev \ | |
| python3.11-venv \ | |
| python3-pip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ββ Make python3 point to python3.11 βββββββββββββββββββββββββββββββββββββββββ | |
| RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \ | |
| update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 | |
| # ββ Create non-root user (uid=1000) ββββββββββββββββββββββββββββββββββββββββββ | |
| RUN groupadd -g 1000 agent && useradd -u 1000 -g agent -m -s /bin/bash agent | |
| # ββ Upgrade pip and install test runner ββββββββββββββββββββββββββββββββββββββ | |
| RUN python -m pip install --upgrade pip setuptools wheel && \ | |
| pip install pytest pytest-xdist pytest-timeout | |
| # ββ Workspace setup βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN mkdir -p /workspace && chown agent:agent /workspace | |
| # ββ Git configuration (needed for git apply) ββββββββββββββββββββββββββββββββββ | |
| RUN git config --global user.email "agent@code-agent" && \ | |
| git config --global user.name "Code Agent" && \ | |
| git config --global safe.directory '/workspace' | |
| # ββ Switch to non-root user βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| USER agent | |
| WORKDIR /workspace | |
| # ββ Default command βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Actual command is injected by SandboxExecutor at runtime | |
| CMD ["python", "-m", "pytest", "--help"] | |