| FROM python:3.10-slim |
|
|
|
|
| |
| RUN apt-get update && \ |
| apt-get install -y --no-install-recommends openssh-client git && \ |
| rm -rf /var/lib/apt/lists/* |
|
|
| |
| |
| RUN useradd -m -u 1000 user |
| WORKDIR /app |
|
|
|
|
| |
| COPY --chown=user requirements.txt requirements.txt |
|
|
| |
| RUN --mount=type=secret,id=AGENTEVAL_DEPLOY_KEY,mode=0400,required=true \ |
| --mount=type=secret,id=ASTABENCH_DEPLOY_KEY,mode=0400,required=true \ |
| mkdir -p /root/.ssh && chmod 700 /root/.ssh && \ |
| cat /run/secrets/AGENTEVAL_DEPLOY_KEY > /root/.ssh/id_ed25519 && chmod 600 /root/.ssh/id_ed25519 && \ |
| cat /run/secrets/ASTABENCH_DEPLOY_KEY > /root/.ssh/id_astabench && chmod 600 /root/.ssh/id_astabench && \ |
| ssh-keyscan github.com >> /root/.ssh/known_hosts && \ |
| printf 'Host github.com\n User git\n IdentityFile /root/.ssh/id_ed25519\n IdentityFile /root/.ssh/id_astabench\n StrictHostKeyChecking no\n' >> /root/.ssh/config && \ |
| |
| git config --global url."ssh://git@github.com/".insteadOf "https://github.com/" && \ |
| pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
| |
| COPY . . |
| RUN mkdir -p /home/user/data && chown -R user:user /home/user/data |
|
|
| |
| ENV system=spaces |
|
|
| |
| USER user |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["python", "app.py"] |
|
|