diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..e6b7108 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,30 @@ +FROM mcr.microsoft.com/devcontainers/python:1-3.11-bookworm AS d3lta-prod + +ENV PIP_DISABLE_PIP_VERSION_CHECK=on \ + PIP_DEFAULT_TIMEOUT=100 \ + \ + # Poetry + # https://python-poetry.org/docs/configuration/#using-environment-variables + POETRY_VERSION=2.1.1 \ + # make poetry install to this location + POETRY_HOME="/opt/poetry" \ + # do not ask any interactive questions + POETRY_NO_INTERACTION=1 \ + # never create virtual environments automatically + POETRY_VIRTUALENVS_CREATE=false + +RUN pip install --no-cache-dir --upgrade pip +RUN pipx install poetry==${POETRY_VERSION} + +WORKDIR /app +COPY pyproject.toml poetry.lock setup.py README.md ./ +# pre-install dependencies +RUN --mount=type=cache,target=/root/.cache poetry install --no-root + +COPY notebooks /app/notebooks/ +COPY d3lta /app/d3lta/ +RUN --mount=type=cache,target=/root/.cache poetry install + +FROM d3lta-prod AS d3lta-dev + +RUN --mount=type=cache,target=/root/.cache poetry install --with dev \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3b49c12 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,9 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + "dockerFile": "./Dockerfile", + "context": "..", + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {} +} \ No newline at end of file