FROM python:3.10-slim
LABEL maintener="Rémi Heredero <remi.heredero@hevs.ch>"

RUN apt-get update && \
    pip install --no-cache-dir -U pdm && \
    rm -rf /var/lib/apt/lists/*


ENV PATH="/root/.local/bin:$PATH" \
    PDM_USE_VENV=false

WORKDIR /app

COPY src/pyproject.toml src/pdm.lock ./

RUN pdm config python.use_venv false && \
    pdm install -G:all

ENV PYTHONPATH="/app/__pypackages__/3.9/lib" \
    PATH="/app/__pypackages__/3.9/bin:$PATH"
