I want to dockerize the following application, however, for some reason, I can't run it in docker, but it works on my local machine, the file structure goes as follows
Dockerfile
requirements.txt
src
├── database
├── logs
└── scrapers
├── __init__.py
└── taskmanager.py
Here're the contents of my Dockerfile
FROM python:3.10-slim
WORKDIR app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "-m", "src.scrapers.taskmanager"]
For some reason, when I run the application from the root folder on my Windows machine via "python -m src.scrapers.taskmanager" it works, but that's not the case with Docker. Any help?
/usr/local/bin/python: Error while finding module specification for 'src.scrapers.taskmanager' (ModuleNotFoundError: No module named 'src.scrapers')
Dockerfileand you've already copiedrequirements.txt, can you try replacing theCOPYwithCOPY src src?__init__.pyin thesrcfolder? That's necessary to make it a module.