Python module not found in docker

  django, docker, dockerfile, python

I am trying to start my django project with Docker and it works fine until I add any apps.
I checked django code itself by running it with PowerShell and it worked fine.

This is my Dockerfile:

FROM python:3
ENV PYTHONUNBUFFERED=1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
ADD . /authenticate

and docker-compose.yml file

version: "3.8"
   
services:
  db:
    image: postgres
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
  web:
    build: .
    command: python manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db

"authenticate" is the app name

I use docker-compose build and docker-compose up to launch project and I get following error message:

 ModuleNotFoundError: No module named 'authenticate'

Source: Docker Questions

LEAVE A COMMENT