FROM python:3.14-slim

WORKDIR /app

# 1. Install system basics
RUN apt-get update && apt-get install -y libpq-dev gcc && rm -rf /var/lib/apt/lists/*

# 2. Copy EVERYTHING first (so the 'app' folder actually exists)
COPY . .

# 3. Now install. Use --no-cache-dir to keep the image small
RUN pip install .

# 4. Standard FastAPI command
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]