[Django]-Docker-compose can't import Django (ModuleNotFoundError)

1👍

instead of

COPY Pipfile Pipfile.lock /code/
RUN pip install pipenv && pipenv install --system

you may use:

RUN pip install pipenv
COPY pipfile* /tmp
RUN cd /tmp && pipenv lock --requirements > requirements.txt
RUN pip install -r /tmp/requirements.txt

this is a snippet from here

6👍

Hi I just solved the problem.
After you run

docker build .

run the docker-compose build instead of docker-compose up.

And then finally run docker-compose up

Leave a comment