-
Notifications
You must be signed in to change notification settings - Fork 412
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (50 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
63 lines (50 loc) · 1.74 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
##### Base image
FROM python:3.13-slim AS base
ENV PYTHONUNBUFFERED=1
ENV UV_PROJECT_ENVIRONMENT=/app/.venv
ENV PATH="/app/.venv/bin:$PATH"
RUN pip install uv
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy \
uv sync --locked --no-dev --no-install-project
COPY main.py src ./
RUN python -m compileall -q .
ENV AGENT_CONFIG=/app/agent.yaml
COPY <<EOF ./entrypoint.sh
#!/bin/sh
set -e
if test -f /run/secrets/openai-api-key; then
export OPENAI_API_KEY=$(cat /run/secrets/openai-api-key)
fi
if test -n "\${OPENAI_API_KEY}"; then
echo "Using OpenAI with \${OPENAI_MODEL_NAME}"
export LLM_AGENT_MODEL_PROVIDER=openai
export LLM_AGENT_MODEL_NAME=\${OPENAI_MODEL_NAME}
else
echo "Using Docker Model Runner with \${MODEL_RUNNER_MODEL}"
export LLM_AGENT_MODEL_PROVIDER=docker
export LLM_AGENT_MODEL_NAME=\${MODEL_RUNNER_MODEL}
fi
exec \$@
EOF
RUN chmod +x ./entrypoint.sh
RUN useradd --create-home --shell /bin/bash app \
&& chown -R app:app /app
USER app
##### Critic Agent
FROM base AS critic-agent
COPY --chown=app:app agents/critic.yaml /app/agent.yaml
CMD ["./entrypoint.sh", "python", "main.py", "--host", "0.0.0.0", "--port", "8001"]
##### Reviser Agent
FROM base AS reviser-agent
COPY --chown=app:app agents/reviser.yaml /app/agent.yaml
CMD ["./entrypoint.sh", "python", "main.py", "--host", "0.0.0.0", "--port", "8001"]
##### Auditor Agent
FROM base AS auditor-agent
COPY --chown=app:app agents/auditor.yaml /app/agent.yaml
EXPOSE 8080
CMD ["./entrypoint.sh", "adk", "web", ".", "--host", "0.0.0.0", "--port", "8080"]
# Use this to expose the agent as a web service instead of a UI
#CMD ["python", "main.py", "--host", "0.0.0.0", "--port", "8002"]