-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (46 loc) · 2.03 KB
/
Dockerfile
File metadata and controls
60 lines (46 loc) · 2.03 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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
WORKDIR /app
ENV UV_SYSTEM_PYTHON=1 \
UV_COMPILE_BYTECODE=1 \
DOCKER_CONTAINER=1 \
OTEL_PYTHON_LOG_CORRELATION=true \
PYTHONUNBUFFERED=1 \
CLAUDE_CODE_USE_BEDROCK=1
# Install Node.js for claude-code CLI
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Install claude-code globally
RUN npm install -g @anthropic-ai/claude-code@2.1.73
# Copy pyproject.toml and shared modules for FAST installation
COPY pyproject.toml .
COPY gateway/ gateway/
COPY tools/ tools/
# Copy and install agent-specific requirements
COPY patterns/claude-agent-sdk-multi-agent/requirements.txt requirements.txt
RUN uv pip install --no-cache -r requirements.txt && \
uv pip install --no-cache aws-opentelemetry-distro==0.16.0
# Install FAST package with only core dependencies
RUN uv pip install --no-cache -e . --no-deps && \
uv pip install --no-cache requests>=2.31.0
# Create non-root user and ensure claude config dir is writable
RUN useradd -m -u 1000 bedrock_agentcore && \
mkdir -p /home/bedrock_agentcore/.claude && \
chown -R bedrock_agentcore:bedrock_agentcore /home/bedrock_agentcore/.claude
USER bedrock_agentcore
ENV CLAUDE_CONFIG_DIR=/home/bedrock_agentcore/.claude
EXPOSE 8080
# Copy agent code files
COPY patterns/claude-agent-sdk-multi-agent/agent.py .
COPY patterns/claude-agent-sdk-multi-agent/code_int_mcp/ code_int_mcp/
COPY patterns/claude-agent-sdk-multi-agent/agents/ agents/
COPY patterns/utils/ utils/
# Healthcheck using Python
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/ping', timeout=2)" || exit 1
# Start agent with OpenTelemetry instrumentation
CMD ["opentelemetry-instrument", "python", "-m", "agent"]