PyCharm Docker Deployment “[Errno 2] No such file or directory”
I’ve set up the Docker Deployment plugin on PyCharm, however, on hitting play, the Deploy log shows a failure with:
Could not open requirements file: [Errno 2] No such file or directory: 'environments/dev/requirements.txt'
I assume that this has something to do with the docker build context that is part of the Docker Deployment plugin. I’ve confirmed that there is in fact a requirements.txt file in the environments/dev/ directory inside the root of my PyCharm project. Does anyone know how to specify the docker build context/path in PyCharm or the Docker Deployment plugin?
RUN ls -l to the Dockerfile, I was able to deduce that the plugin is running from the same directory as the Dockerfile. Still looking for a way to specify the build path if it’s at all possible.
One Solution collect form web for “PyCharm Docker Deployment “[Errno 2] No such file or directory””
My current solution to this problem is to move the Dockerfile to the root directory of my PyCharm project so that when
ADD . /var/app is run, it copies over the correct files. As I mentioned in the “UPDATE”, the PyCharm plugin uses the directory the Dockerfile is run from as the build context/path.
Would still like to be able to specify the build path, but this may be the best solution given the limitations of the plugin.