# Stage 1: Build dependencies FROM python:3.9-alpine as builder # Install build dependencies RUN apk add --no-cache \ build-base \ gcc \ musl-dev \ python3-dev \ libffi-dev \ openssl-dev \ cargo \ git # Set the working directory WORKDIR /install # Copy requirements COPY requirements.txt . # Install dependencies RUN pip install --prefix=/install --no-cache-dir -r requirements.txt # Stage 2: Run FROM python:3.9-alpine # Copy installed dependencies from builder COPY --from=builder /install /usr/local # Set the working directory WORKDIR /app # Copy application code COPY . . # Make port 8000 available EXPOSE 8000 # Set environment variable ENV AGENT_NAME World # Run the application CMD ["python", "agent.py"]