FROM --platform=linux/arm64 python:3.12-slim WORKDIR /app # Install system dependencies that might be needed RUN apt-get update && apt-get install -y \ gcc \ g++ \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt . # Upgrade pip and install requirements RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Copy shared configuration manager (project-wide) #COPY shared/ ./shared/ # Copy static configuration (embedded in container) COPY config/static-config.yaml ./config/ # Copy dynamic configuration (contains gateway URL and runtime info) COPY config/dynamic-config.yaml ./config/ # Copy agent-specific shared helper functions to agent_shared directory (avoid overwrite) COPY agentcore-runtime/src/agent_shared/ ./agent_shared/ # Copy agent implementation COPY agentcore-runtime/src/agents/diy_agent.py . # Signal that this is running in Docker for host binding logic #ENV DOCKER_CONTAINER=1 RUN python -m pip install --no-cache-dir aws_opentelemetry_distro_genai_beta>=0.1.2 # Create non-root user RUN useradd -m -u 1000 bedrock_agentcore USER bedrock_agentcore # Expose port 8080 (AgentCore requirement) EXPOSE 8080 # Comment below to run in agentcore runtime # Uncomment below to run in local container on desktop #CMD ["uvicorn", "diy_agent:app", "--host", "0.0.0.0", "--port", "8080"] # Uncomment below to run in agentcore runtime # Comment below to run in local container on desktop CMD ["opentelemetry-instrument", "python", "diy_agent.py"]