Pycharm attaches new container on each run of debugger

Answered

I have a docker-compose running 4 containers.

I run my interpreter using container_1.

When I debug a file I first get

    container_2 is up-to-date
    Starting docker_pycharm_helpers_1 ...
    container_3 is up-to-date
    container_4 is up-to-date
    Recreating container_1 ...
    Attaching to container_1

each debug run spins up the container again.

1. This means I can't run 2 debuggers together as once attaching a container, it closes to active one.

2. The overhead for doing this takes a lot of time

The desired behaviour would be to have the container always mounted until specified otherwise, and have the debug console just spin up a new python process inside the container.

0
3 comments

Hi Deanla, I believe your problem is covered by https://youtrack.jetbrains.com/issue/WI-37986 Please feel free to follow and comment.

0
Avatar
Permanently deleted user

Pavel Karateev I'm trying to find the option to connect to an existing container defined in a docker-compose file in Pycharm, but i'm unable to find it. In PHP Storm it's available when you edit the CLI intepreter that is found in the container. However I do not see this option under Pycharm. Is this correct? How to configure connecting to an already existing container defined in a docker-compose file.

 

How it can be done in PHP storm:

0

Hi WayofKs, you can specify exec in "Command and options" field

0

Please sign in to leave a comment.