-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (32 loc) · 986 Bytes
/
Dockerfile
File metadata and controls
39 lines (32 loc) · 986 Bytes
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
# Use Python 3.11 slim image as base
FROM python:3.13-slim
ENV PYTHONUNBUFFERED=1
RUN pip install uv
WORKDIR /app
# Install system dependencies
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
UV_COMPILE_BYTECODE=1 uv pip install --system .
# Copy application code
COPY agents/ ./agents/
RUN python -m compileall -q .
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}"
# else
echo "Using Docker Model Runner with \${MODEL_RUNNER_MODEL}"
export OPENAI_MODEL_NAME=openai/\${MODEL_RUNNER_MODEL}
# fi
exec adk api_server --host 0.0.0.0 --port 8000 --log_level DEBUG
EOF
RUN chmod +x /entrypoint.sh
# Create non-root user
RUN useradd --create-home --shell /bin/bash app \
&& chown -R app:app /app
USER app
ENTRYPOINT [ "/entrypoint.sh" ]