-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (34 loc) · 1.5 KB
/
Dockerfile
File metadata and controls
45 lines (34 loc) · 1.5 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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
WORKDIR /app
# Configure UV for container environment
ENV UV_SYSTEM_PYTHON=1 \
UV_COMPILE_BYTECODE=1 \
DOCKER_CONTAINER=1 \
OTEL_PYTHON_LOG_CORRELATION=true \
PYTHONUNBUFFERED=1
# Copy pyproject.toml and gateway package for FAST installation
COPY pyproject.toml .
COPY gateway/ gateway/
COPY tools/ tools/
# Copy and install agent-specific requirements first
COPY patterns/strands-single-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 (no dev/agent optional deps)
RUN uv pip install --no-cache -e . --no-deps && \
uv pip install --no-cache requests>=2.31.0
# Create non-root user
RUN useradd -m -u 1000 bedrock_agentcore
USER bedrock_agentcore
EXPOSE 8080
# Copy agent code files
COPY patterns/strands-single-agent/basic_agent.py .
COPY patterns/strands-single-agent/strands_code_interpreter.py .
COPY patterns/utils/ utils/
# Healthcheck using Python (no extra dependencies needed)
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", "basic_agent"]