FROM python:3.12-slim

WORKDIR /app

# Install dependencies first (layer-cached).
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install djraphdb itself from the project root (one directory up from this
# example).  In the docker-compose.yml the project root is bind-mounted at
# /djraphdb so changes are picked up live.
RUN pip install --no-cache-dir -e /djraphdb 2>/dev/null || true

COPY . .
