FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04

ENV DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC"

RUN \
    apt-get update && \
    apt-get install -y --no-install-recommends \
        make \
        curl \
        git \
        build-essential \
        && \
    true

RUN \
    apt-get install -y --no-install-recommends \
        libdb-dev \
        libjpeg-dev \
        && \
    true

RUN \
    apt-get install -y --no-install-recommends \
        default-jre-headless \
        && \
    true

RUN \
    apt-get install -y --no-install-recommends \
        software-properties-common \
        && \
    apt-get install -y --no-install-recommends \
        python3 \
        python3-pip \
        python3-dev \
        python3-venv \
        python-is-python3 \
        && \
    python --version && \
    true

RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin

COPY devtools/requirements-poetry.in /var/tmp/

RUN \
    python -m pip install --upgrade \
        tox \
        pre-commit \
        -r /var/tmp/requirements-poetry.in \
        && \
    true

RUN git config --system --add safe.directory /srv/workspace
