Hello, I am new to docker and I have some difficulties trying to interface pycharm properly with my docker container.
As I seem to understand, pycharm mounts my project directory to /opt/project and it runs the scripts from said directory.
I have a problem: even if a user defined library is present in my project directory (MyLib.py, for example), it is not recognized by the interpreter in the PythonConsole. I've figured out that this may be due to "/opt/project" not being present in the PYTHONPATH env variable. I've edited my dockerfile and added said folder to the PYTHONPATH variable, but apparently pycharm overwrites that env variable upon the automatic creation of the container, which makes my efforts useless...
A workaround is to start a PythonConsole manually and add /opt/project to path (with sys.path.insert, for example) or to edit the run config to point to the right file (pycharm apparently doesn't correctly choose /opt/project/test.py and tries to run it in D:/.../local/folder/test.py) and the right working directory (/opt/project)... Which is tedious!
Is there a way to fix this problem? Did I configure something wrong?
Thank you for your help!