Debug django app running inside docker image, using pycharm debugger
Asked Answered
M

1

16

My app is running inside a docker image (My development team never install software in their machines, only the docker images have the dependencies).

I Need to debug something using pycharm debugger, how do I connect pycharm's debugger to the docker image's python?

Monochrome answered 14/4, 2015 at 18:57 Comment(0)
M
12

One possible method is to treat your Docker container as a remote host and use remote debugging: https://www.jetbrains.com/pycharm/help/remote-debugging.html

Metallo answered 15/4, 2015 at 2:44 Comment(3)
Do you know how to successfully enable ssh server inside my docker image in order to remote debug it?Monochrome
You'll need to install sshd. Maybe you can convince your team to update the docker image with sshd, or you can create your own based off the original image. You'll need to be running both your python application and your ssh server at the same time, so you might want to use supervisord or maybe a solution like phusion-baseimage.Metallo
Please check https://mcmap.net/q/41134/-how-to-access-host-port-from-docker-container-duplicate for an up-to-date solution.Bilek

© 2022 - 2024 — McMap. All rights reserved.