FROM python:3.13-slim AS runtime

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

WORKDIR /app

RUN apt-get update \
    && apt-get install -y --no-install-recommends git \
    && rm -rf /var/lib/apt/lists/*

COPY pyproject.toml README.md ./
COPY alembic.ini ./
COPY alembic ./alembic
COPY gnexus_creds ./gnexus_creds

RUN pip install --no-cache-dir .

EXPOSE 8000

CMD ["uvicorn", "gnexus_creds.main:app", "--host", "0.0.0.0", "--port", "8000"]
