# Stage 1: Builder — install dependencies with uv FROM python:3.13-slim AS builder COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ WORKDIR /app COPY pyproject.toml uv.lock ./ RUN uv venv /opt/venv && . /opt/venv/bin/activate && uv pip install --no-cache -r pyproject.toml # Stage 2: Runtime FROM python:3.13-slim WORKDIR /app COPY --from=builder /opt/venv /opt/venv COPY . . ENV PATH="/opt/venv/bin:$PATH" \ PYTHONUNBUFFERED=1 EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]