I am new to docker and trying to move one simple application to docker. Python standard modules I am able to import using "pip install". However, I have some custom python utility files that I would like to use. These files are in separate package "utils".
In my main python file : test.py
, I am doing
from utils import math.py, logger.py
This outside of docker works fine, but when running through docker gives me the error "ImportError: No module named utils"
.
My Dockerfile code:
FROM python:2.7.11
ADD ./ test_project/
WORKDIR test_project
ENV PATH=$PATH:/test_project/utils
ENV PYTHONPATH /test_project/utils
CMD [ "python", "report/test.py"]
My directory structure:
test_project
report
utils
Any suggestions?