Dockerfile Preparing editable metadata (pyproject.toml) did not run successfully

Working on a fairly simple django task. It works as expected. I am trying to build and run a docker. It is the Dockerfile:

FROM python:3.10

ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PIP_NO_CACHE_DIR=off \
    POETRY_NO_INTERACTION=1 \
    POETRY_NO_ANSI=1 \
    APP_PATH="/usr/src"

WORKDIR $APP_PATH

RUN pip install poetry

COPY poetry.lock pyproject.toml ./

# --no-dev is depricated (--only main)
RUN poetry install --no-root --only main

# Copy in source code.
COPY . .

# Install ourselves; all dependencies should be there already.
RUN pip install --no-input --no-color --no-deps -e .

EXPOSE 8000

It fails in RUN pip install -e . line!

It is also pyproject.toml :

[tool.poetry]
name = "dj-task"
version = "0.1.0"
description = ""
readme = "README.md"
packages = [{include = "dj_task"}]

[tool.poetry.dependencies]
python = "^3.10"
Django = "^4.1.3"
requests = "^2.28.1"
Pillow = "^9.3.0"
mimetype = "^0.1.5"
pandas = "^1.5.2"
celery = "^5.2.7"
django-redis = "^5.2.0"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

The final error is Preparing editable metadata (pyproject.toml): started Preparing editable metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error

× Preparing editable metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): ...... File "/tmp/pip-build-env-wgrjgnli/overlay/lib/python3.10/site-packages/poetry/core/masonry/utils/package_include.py", line 66, in check_elements raise ValueError( ValueError: /usr/src/dj_task does not contain any element [end of output] enter image description here enter image description here

Back to Top