FROM python:3.11-slim

WORKDIR /app

# Install dependencies
COPY pyproject.toml ./
RUN pip install --no-cache-dir -e .

# Copy application code
COPY agent_attribution ./agent_attribution

# Create data directory for SQLite
RUN mkdir -p /app/data

# Expose port
EXPOSE 8080

# Run migrations and start server
CMD ["uvicorn", "agent_attribution.main:app", "--host", "0.0.0.0", "--port", "8080"]
