-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (50 loc) · 2.02 KB
/
Dockerfile
File metadata and controls
66 lines (50 loc) · 2.02 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
58
59
60
61
62
63
64
65
66
FROM python:3.11-slim AS builder
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git && \
rm -rf /var/lib/apt/lists/*
COPY pyproject.toml README.md ./
COPY src/ src/
RUN pip install --no-cache-dir --prefix=/install \
"agentfield>=0.1.0" \
"pydantic>=2.0" \
"httpx>=0.27" \
"python-dotenv>=1.0" && \
pip install --no-cache-dir --prefix=/install --no-deps .
FROM python:3.11-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
HARNESS_PROVIDER=opencode \
HARNESS_MODEL=openrouter/minimax/minimax-m2.5 \
AI_MODEL=openrouter/minimax/minimax-m2.5 \
PORT=8080 \
HOME=/home/secaf \
PYTHONPATH=/app/src \
PATH=/home/secaf/.opencode/bin:${PATH}
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git && \
groupadd --gid 10001 secaf && \
useradd --uid 10001 --gid secaf --create-home --home-dir /home/secaf --shell /bin/sh secaf && \
su -s /bin/sh secaf -c "curl -fsSL https://opencode.ai/install | bash" && \
mkdir -p /workspaces && \
chown -R secaf:secaf /app /workspaces /home/secaf && \
rm -rf /var/lib/apt/lists/*
# Generate minimal opencode config for OpenRouter provider (no MCP servers)
RUN mkdir -p /home/secaf/.config/opencode && \
echo '{"$schema":"https://opencode.ai/config.json","model":"openrouter/minimax/minimax-m2.5","small_model":"openrouter/minimax/minimax-m2.5","provider":{"openrouter":{"options":{"apiKey":"{env:OPENROUTER_API_KEY}"},"models":{"minimax/minimax-m2.5":{},"moonshotai/kimi-k2.5":{}}}}}' \
> /home/secaf/.config/opencode/opencode.json && \
chown -R secaf:secaf /home/secaf/.config
COPY --from=builder /install /usr/local
COPY src/ /app/src/
COPY prompts/ /app/prompts/
USER secaf
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
CMD ["python", "-m", "sec_af.app"]