# Use a minimal Python image
FROM python:3.12-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl build-essential \
    && rm -rf /var/lib/apt/lists/*

# Install uv package manager
RUN pip install --upgrade pip setuptools wheel uv

# Copy dependency files
COPY pyproject.toml /app/

# Install dependencies using uv
RUN uv sync

# Copy project code
COPY . /app

# Expose FastAPI port
EXPOSE 8000

# Run app using uv
CMD ["uv", "run", "main.py"]
