我想把下面的应用程序docker化,但是,由于某种原因,我不能在docker中运行它,但它在我的本地机器上运行,文件结构如下
Dockerfile
requirements.txt
src
├── database
├── logs
└── scrapers
├── __init__.py
└── taskmanager.py
这是我的 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"]
出于某种原因,当我通过“python -m src.scrapers.taskmanager”从我的 Windows 机器上的根文件夹运行应用程序时,它可以工作,但 Docker 并非如此。有帮助吗?
/usr/local/bin/python: Error while finding module specification for 'src.scrapers.taskmanager' (ModuleNotFoundError: No module named 'src.scrapers')