I have an application that I've set up to run with docker-compose, so I've set up a Project Interpreter in PyCharm to be the interpreter of a service that I'm running with docker-compose. I have an entrypoint in my Dockerfile at `./bin/docker-entrypoint.sh`. When running a unit test, I get the following error indicating that the entrypoint cannot be found.
ERROR: for 9f851185904f_REDACTED Cannot start service REDACTED: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"./bin/docker-entrypoint.sh\": stat ./bin/docker-entrypoint.sh: no such file or directory": unknown
I notice that PyCharm runs the following docker-compose command, which indicates it starts my service by using both my docker-compose.yml and its own docker-compose.override.yml
/usr/local/bin/docker-compose -f REDACTED/docker-compose.yml -f REDACTED/Library/Caches/PyCharm2018.2/tmp/docker-compose.override.168.yml up --exit-code-from REDACTED --abort-on-container-exit REDACTED
I looked in the docker-compose.override, and it includes the following:
This would explain why my entrypoint wasn't found -- my entrypoint is defined as a relative path but PyCharm changes the working directory. If I delete the definition of my entrypoint within my Dockerfile and my docker-compose.yml, then the tests run successfully.
My question is, what's the best practice in configuring docker-compose.yml, Dockerfiles and entrypoints to get tests running in PyCharm?