I have imported my entire project into docker, and I am getting a
ModuleNotFoundError
from one of the modules I have created.
FROM python:3.8
WORKDIR /workspace/
COPY . /workspace/
RUN pip install pipenv
RUN pipenv install --deploy --ignore-pipfile
#EXPOSE 8000
#CMD ["pipenv", "run", "python", "/workspace/bin/web.py"]
I tried looking around for answers, but I cannot seem to get it working.
commands:
docker build -t atletico .
docker run -p 8000:8000 atletico
Docker Build: https://pastebin.com/FXMrY2En
Traceback (most recent call last):File "/workspace/bin/web.py", line 3, in <module>from bin.setup import setup_app
ModuleNotFoundError: No module named 'bin'
A copy of my directory:
├── Dockerfile
├── Pipfile
├── Pipfile.lock
├── README.md
├── bin
│ ├── __init__.py
│ ├── __pycache__
│ │ └── web.cpython-38.pyc
│ ├── setup.py
│ └── web.py
├── docker-compose.yml
├── frio
│ ├── __init__.py
│ ├── __pycache__
│ │ └── __init__.cpython-38.pyc
│ ├── app_events.py
│ └── config.py
├── routes
│ ├── __init__.py
docker-compose.yml:
version: '3'
services:db:image: postgres:12ports:- "5432:5432"environment:- POSTGRES_USER=postgres- POSTGRES_PASSWORD=postgres- POSTGRES_DB=test_dbredis:image: "redis:alpine"web:env_file:- .env.localbuild: .ports:- "8000:8000"volumes:- .:/workspacedepends_on:- db- rediscommand: "pipenv run python /workspace/bin/web.py"