I think I have a pretty common (these days) dev workflow, with multiple docker-compose files.
- docker-compose.dev.yml -- For running the API, web, etc servers.
- docker-compose.test.yml -- For running automated regression tests.
- docler-compose.prod.yml -- You get the idea.
When I'm writing tests and doing coverage, I would use the Python environment in a service specified by "docker-compose.test.yml". However, When I'm testing code in actual use, I would use another service defined in "docker-compose.dev.yml" and its Python interpreter.
For the life of me, I can't figure out how to get this to work well in PyCharm. If I define an interpreter based on docker-compose.dev.yml, then I can't define a separate interpreter in the test dockerfile. I get that it's weird for Python to have "multiple" interpreters, but in actuality they are the same version, same requirements, etc. They just run from different services.
Is this an uncommon approach? How do you all get efficient workflows setup in Docker-compose where you can debug both tests and live code?