forked from Agent-Field/SWE-AF
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (44 loc) · 2.13 KB
/
Copy pathDockerfile
File metadata and controls
57 lines (44 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# System deps: git (worktrees, branches), curl (healthcheck), jq (agent bash),
# openssh-client (optional SSH git), gh CLI (draft PRs)
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl openssh-client jq && \
# Install GitHub CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
| tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
apt-get update && apt-get install -y --no-install-recommends gh && \
# Install OpenCode CLI v1.2+ for opencode provider (with run --model support)
curl -fsSL https://opencode.ai/install | bash && \
rm -rf /var/lib/apt/lists/*
# Add OpenCode to PATH for non-interactive shells
ENV PATH="/root/.opencode/bin:${PATH}"
# Git identity — env vars take highest precedence and are inherited by all
# subprocesses including Claude Code agent instances spawned by the SDK
ENV GIT_AUTHOR_NAME="SWE-AF" \
GIT_AUTHOR_EMAIL="eng@agentfield.ai" \
GIT_COMMITTER_NAME="SWE-AF" \
GIT_COMMITTER_EMAIL="eng@agentfield.ai"
# Configure git identity and use gh CLI as credential helper so all git
# HTTPS operations (clone, push, fetch) authenticate via GH_TOKEN at runtime.
RUN git config --global user.name "SWE-AF" && \
git config --global user.email "eng@agentfield.ai" && \
gh auth setup-git --hostname github.com --force
# Install uv for fast package installation
RUN pip install --no-cache-dir uv
# Install project dependencies
COPY requirements-docker.txt /app/requirements.txt
RUN uv pip install --system -r /app/requirements.txt
# Copy application code
COPY . /app/
EXPOSE 8003
ENV PORT=8003 \
AGENTFIELD_SERVER=http://control-plane:8080 \
NODE_ID=swe-planner
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost:${PORT}/health || exit 1
CMD ["python", "-m", "swe_af"]