I use PyCharm for my python development and normally I use a virtual env but now I found poetry and it manages the dependencies in a better way than just having a pip requirements file.
I had issues loading correctly a poetry environment from docker compose into pycharm available environments.
This sometimes works, sometimes I just reload the entire environment.
Run your docker image of course.
Go to the Python Project Settings at: Project Interpreter
Click over Python Interpreter and select Show All...
Click over the +
button and add a new docker compose item.
Continue through the wizard and select your Docker service correctly.
The wizard will try to run docker? I dont know why it fails over my pycharm or what but it does not seem to matter.
Shell into your docker container and execute: poetry env info -p
and copy that path and include /bin/python
On the wizard click over the 3 dots: ...
Add the path from the poetry environment but remember to add /bin/python
at the end.
And hopefully... you will have your environment correctly.
Happy coding.
There is an actual YouTrack issue to follow if you are interesting in something from jetbrains: https://youtrack.jetbrains.com/issue/PY-42909/Support-poetry-in-docker-compose-python-interpreter
thanks for this page @jmsalcido , it's worked perfectly with this explanations.