Python Docker Issues

Hello I’m trying to run a Django python project on docker but when I try to build the Dockerfile I get this error:

Note that only Django core commands are listed as settings are not properly configured (error: No module named ‘settings’).

This is the Dockerfile:

FROM python:3

ADD manage.py /

COPY requirements.txt /tmp
WORKDIR /tmp
RUN pip install -r requirements.txt 

WORKDIR / 

CMD [ "python", "manage.py" ]

However when I run the command

python manage.py

I get no errors and the settings file is loaded correctly… So I guess that my computer does know that the file exists but can’t acknowledge it through docker for some reason ?

This is my manage .py file:

import os
import sys


def main():
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)


if __name__ == '__main__':
    main()

I’m a beginner and have been stuck on this for some days now, I looked for solutions online but they didn’t work… I will really appreciate your help!
Also I hope i’m posting in the correct forum

As far as I can tell, DJANGO_SETTINGS_MODULE is the name of a Python module Django imports to get the settings from[1]. In your case this is “settings”, which would be imported from a file settings.py.
I assume you have a settings.py file in your local directory, which is why it works, but you aren’t copying it into the docker container.

This should be solvable by adding ADD settings.py / to your dockerfile.

[1] Django settings | Django documentation | Django