# Generated by minix from the minix extras in __SOURCE__. Do not edit: `minix sync docker` and
# `minix add …` overwrite it (after showing the changes). Put your changes in compose.override.yaml;
# to build on another Python, set the PYTHON_VERSION build arg there.
ARG PYTHON_VERSION=3.12
FROM python:${PYTHON_VERSION}-slim

WORKDIR /app

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        pkg-config \
# __BEGIN_RAG__
        poppler-utils \
# __END_RAG__
# __BEGIN_POSTGRESQL__
        libpq-dev \
# __END_POSTGRESQL__
# __BEGIN_MYSQL__
        default-libmysqlclient-dev \
# __END_MYSQL__
    && rm -rf /var/lib/apt/lists/*

# __BEGIN_POETRY_PACKAGES__
# The Python packages, minix included, exactly as poetry.lock pins them.
COPY pyproject.toml poetry.lock ./
RUN pip install --upgrade pip && pip install "poetry>=2,<3" \
    && poetry config virtualenvs.create false \
    && poetry install --only main --no-root --no-interaction

# __END_POETRY_PACKAGES__
# __BEGIN_REQUIREMENTS_PACKAGES__
# The Python packages, minix included, as requirements.txt lists them.
COPY requirements.txt ./
RUN pip install --upgrade pip && pip install -r requirements.txt

# __END_REQUIREMENTS_PACKAGES__
COPY . .

ENV PYTHONUNBUFFERED=1 \
    MINIX_SETTINGS_MODULE=config \
    APP_PORT=8000

EXPOSE 8000

CMD ["sh", "-c", "uvicorn entries.api:Api --host 0.0.0.0 --port ${APP_PORT}"]
