FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    MPLBACKEND=Agg

RUN useradd --create-home --uid 1000 navigator

WORKDIR /workspace

COPY pyproject.toml README.md ./
COPY config ./config
COPY marine_nav ./marine_nav
COPY tests ./tests

RUN python -m pip install --no-cache-dir --upgrade pip && \
    python -m pip install --no-cache-dir --editable '.[dev,notebook]'

RUN mkdir -p /workspace/outputs && chown -R navigator:navigator /workspace

USER navigator

CMD ["bash"]
