All containers here. Our stack is way too complicated to even think about running it using the host. We use docker compose, usually 5 or 6 different compose stacks connected by a common network. We use pycharm rather than vscode. Pycharm's support for debugging etc in containers is ok, but its devcontainers support is lacking. Answer from spuds_in_town on reddit.com
🌐
JetBrains
jetbrains.com › help › pycharm › connect-to-devcontainer.html
Dev Container overview | PyCharm Documentation
October 23, 2024 - A Development Container (Dev Container) is a Docker container configured to be used as a fully functional development environment. PyCharm lets you use such containers to edit, build, and run your projects.
The only Python IDE you need
Built for web, data, and AI/ML professionals. Supercharged with an AI-enhanced IDE experience.
Buy IntelliJ IDEA
Buy IntelliJ IDEA and take your professional Java and Kotlin development experience to the next level!
Download IntelliJ IDEA
Download the latest version of IntelliJ IDEA, the leading IDE for professional development in Java and Kotlin. Available for Windows, macOS, and Linux.
Download PyCharm
Download the latest version of PyCharm for Windows, macOS or Linux.
🌐
JetBrains
jetbrains.com › help › pycharm › start-dev-container-from-scratch.html
Start Dev Container from scratch | PyCharm Documentation
February 5, 2026 - The easiest way to start is to pull an image (a predefined template) for your devcontainer.json file from a container registry (the collection of repositories with the predefined images). Open a project in PyCharm.
🌐
JetBrains
jetbrains.com › help › pycharm › start-dev-container-inside-ide.html
Start Dev Container inside IDE | PyCharm Documentation
February 5, 2026 - You can open a local project that has the .devcontainer folder with the devcontainer.json file in the root inside PyCharm and start a Dev Container from the IDE by using Docker.
🌐
JetBrains
jetbrains.com › help › pycharm › dev-containers-starting-page.html
Dev Containers | PyCharm Documentation
Need help? Here is the complete coverage for all JetBrains products, languages, and tools.
🌐
JetBrains
jetbrains.com › help › pycharm › start-dev-container-for-a-remote-project.html
Start Dev Container for a remote project | PyCharm Documentation
February 5, 2026 - The project to which you are referring should have a devcontainer.json file that contains the Dev Container configuration. This option lets you choose a project residing on your remote machine. Specify a path to the .json file of the project. This option lets you specify a project residing on GitHub. Specify the following options: Git Repository: specify the path to your project on GitHub. Automatic: select this option if you want PyCharm to detect the .json file automatically.
🌐
JetBrains
jetbrains.com › help › pycharm › faq-about-dev-containers.html
FAQ about Dev Containers | PyCharm Documentation
October 3, 2024 - You can build a Dev Container for a project with the .json file that resides on the remote backend.
🌐
JetBrains
jetbrains.com › help › pycharm › prerequisites-for-dev-containers.html
Prerequisites for a local Dev Container - PyCharm
May 1, 2025 - You have a project that contains the .devcontainer folder with the devcontainer.json file that describes the actual Dev Container.
Find elsewhere
🌐
JetBrains
jetbrains.com › help › pycharm › customizing-devcontainer-json-file.html
Customizing various Dev Container settings | PyCharm Documentation
October 2, 2025 - In the Services tool window, select Docker | Dev Containers and the necessary container.
🌐
Reddit
reddit.com › r/python › are there many of you on here who do all their python development inside a container?
r/Python on Reddit: Are there many of you on here who do all their Python development inside a container?
June 28, 2025 -

I tried to run my app in a container during development a few years ago in vscode, but it didn't feel right at all. Within the few i spoke to who also tried this it didn't resonate either and most did their python development locally. They only used containers for development services.

I wonder if things have changed. It looks like you still need to do a lot of custom config to debug a container in vscode. Does hot reload work? Intellisense? click through to system modules? I wonder if the consensus is different in 2025.

🌐
NimblePros
blog.nimblepros.com › blogs › introduction-to-dev-containers
Introduction to Dev Containers | NimblePros Blog
September 19, 2024 - These are some of the IDEs and editors that support dev containers: Visual Studio · IntelliJ IDEA · JetBrains Rider · Visual Studio Code · JetBrains WebStorm · JetBrains PyCharm · For the Ruby project, I needed to make sure I had Ruby, Active Record, and SQLite3.
🌐
JetBrains
blog.jetbrains.com › idea › 2024 › 07 › using-dev-containers-in-jetbrains-ides-part-1
Using Dev Containers in JetBrains IDEs – Part 1 | The IntelliJ IDEA Blog
September 16, 2025 - Dev Containers are Docker containers containing everything necessary for software development, including IDEs, specific software, tools, libraries, and even configured services, in an isolated environment that can be easily transferred and launched ...
🌐
GitHub
github.com › JetBrains › devcontainers-examples
GitHub - JetBrains/devcontainers-examples · GitHub
demoApps/: Contains sample applications configured to run in DevContainers · customizations/: Shows how to customize DevContainers with plugins and extensions · gpu_amd64/: Provides examples for GPU support in DevContainers · Docker installed on your local machine · A JetBrains IDE with DevContainers support (IntelliJ IDEA, PyCharm, WebStorm, etc.)
Starred by 96 users
Forked by 12 users
Languages   Dockerfile 72.3% | CSS 9.0% | HTML 8.8% | JavaScript 5.0% | Python 4.9%
🌐
JetBrains
jetbrains.com › help › pycharm › recent-dev-containers.html
Recent Dev Containers | PyCharm Documentation
November 7, 2025 - To view and manage previously used containers, click Remote Development in the left-hand pane of the Welcome screen and select Dev Containers.
🌐
JetBrains
jetbrains.com › help › pycharm › troubleshooting-dev-containers.html
Troubleshooting Dev Container issues | PyCharm Documentation
PyCharm does not detect the terminated connection because the ijent process itself is not stopped—it simply stops responding to requests, causing all requests to hang. The potential reasons for such behavior include the following: docker container pause (invoked manually or from Docker Desktop) suspends the container. If the Dev ...
🌐
Xlwings
server.xlwings.org › en › 1.1.0 › devcontainers
Dev Containers - xlwings Server documentation
Dev containers allow you to run your complete development environment in a container without having to install anything locally other than Docker and an editor. In contrast to Docker-based Development, it integrates your editor much better so that things like debugging and code navigation work ...
🌐
Medium
medium.com › cloudnativepub › dev-containers-vs-code-vs-jetbrains-ides-207556d81bfe
Dev Containers: VS Code vs. JetBrains IDEs | by Saeed Zarinfam | CloudCraft | Medium
February 19, 2026 - JetBrains IDEs ∘ Free vs Paid ∘ Supporting Dev Container Specification ∘ Add a devcontainer file to an existing project ∘ Open a Local folder or a git repo as a container ∘ Attach to a running container (Docker and K8s) ∘ Rebuild the dev containers ∘ Dev container on the Remote machine ∘ Performance ∘ More features in VS Code ∘ Customizations (settings and extensions) ·
🌐
Microsoft Learn
learn.microsoft.com › en-us › azure › developer › python › containers-in-azure-overview-python
Overview of Python Container Apps in Azure - Python on Azure | Microsoft Learn
April 23, 2025 - Integrated development environments (IDEs) like Visual Studio Code (VS Code) and PyCharm streamline Python container development by integrating Docker tasks into your workflow. With extensions or plugins, these IDEs simplify building Docker images, running containers, and deploying to Azure services like App Service or Container Instances.
🌐
Docker
docker.com › blog › streamlining-local-development-with-dev-containers-and-testcontainers-cloud
Streamlining Local Development with Dev Containers and Testcontainers Cloud | Docker
September 18, 2024 - This description of an isolated environment can be easily transferred and launched on any computer or cloud infrastructure, allowing developers and teams to abstract away the specifics of their operating systems. The dev container settings are defined in a devcontainer.json file, which is located within a given project, ensuring consistency across different environments.
🌐
LinkedIn
linkedin.com › posts › martinmarcher_jetbrains-intellij-pycharm-activity-6976145178717769729-t1wW
Martin Marcher on LinkedIn: #jetbrains #intellij #pycharm #development #remote #containers #vscode… | 12 comments
September 15, 2022 - My main points were: * Remote development is a primary target * remote development in a container needs to work the same way as remote development via SSH * opening an SSH remote IDE should still allow to go down one more level to use a CI tai er in that machine * devcontainers is absolutely important, just by the sheer amount of things that exist Thank you for listening. Thank you everyone for sharing this post to make it visible. ... Some co-workers still prefer PyCharm, but wim at the point where I activtrt to convince them to switch to VSCode.
Top answer
1 of 10
14

UPDATE: PyCharm 2017.1 has a solution for this problem, see this blog entry

Here is how I solved the problem. My circumstances are that I was assigned to do an intervention on a specific area of a web app that used docker-compose to create a set of four containers. Docker-compose is a kind of meta docker that manages multiple docker containers from one command. I did not want to mangle their existing setup since so many things depend on it. But since I was working on one specific part in one of the images I decided that I would extend one of the containers with ssh so that I could debug from PyCharm. Further, I wanted the app to run as normal when started and only by forcing it to quit and then connecting to it from PyCharm would I have a debuggable component. Here is what I did on my mac that uses boot2docker (on VirtualBox) to setup docker correctly.

First, I need to extend the target container, called jqworker. I am going to use "supervisior" to do the heavy lifting of managing things.

FROM jqworker

# Get supervisor to control multiple processes, sshd to allow connections.
# And supervisor-stdout allows us to send the output to the main docker output.
RUN apt-get update && apt-get install -y supervisor openssh-server python-pip \
  && pip install supervisor-stdout \
  && mkdir -p /var/run/sshd  \
  && mkdir -p /var/log/supervisor \
  && mkdir -p /etc/supervisor/conf.d

COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Fix up SSH, probably should rip this out in real deploy situations.
RUN echo 'root:soup4nuts' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile

# Expose SSH on 22, but this gets mapped to some other address.
EXPOSE 22

# Replace old entrypoint with supervisiord, starts both sshd and worker.py
ENTRYPOINT ["/usr/bin/supervisord"]

Supervisor lets me run multiple tasks from one command, in this case the original command and SSHD. Yes, everyone says that SSHD in docker is evil and containers should this and that and blah blah, but programming is about solving problems, not conforming to arbitrary dicta that ignore context. We need SSH to debug code and are not deploying this to the field, which is one reason we are extending the existing container instead of adding this in to the deployment structure. I am running it locally so that I can debug the code in context.

Here is the supervisord.conf file, note that I am using the supervisor-stdout package to direct output to supervisor instead of logging the data as I prefer to see it all in one place:

[supervisord]
nodaemon=true

[program:sshd]
command=/usr/sbin/sshd -D

[program:worker]
command=python /opt/applications/myproject/worker.py -A args
directory=/opt/applications/myproject
stdout_events_enabled=true
stderr_events_enabled=true

[eventlistener:stdout]
command = supervisor_stdout
buffer_size = 100
events = PROCESS_LOG
result_handler = supervisor_stdout:event_handler

I have a build directory containing the above two files, and from a terminal in there I build the Dockerfile with:

docker build -t fgkrqworker .

This adds it so that I can call it from docker or docker-compose. Don't skip the trailing dot!

Since the app uses docker-compose to run a set of containers, the existing WORKER container will be replaced with one that solves my problems. But first I want to show that in another part of my docker-compose.yml I define a mapping from the containers to my local hard drive, this is one of a number of volumes being mapped:

volumes: &VOLUMES
  ? /Users/me/source/myproject:/opt/applications/myproject

Then the actual definition for my container, which references the above VOLUMES:

jqworker: &WORKER
  image: fgkrqworker
  privileged: true
  stdin_open: true
  detach: true
  tty: true
  volumes:
    <<: *VOLUMES
  ports:
    - "7722:22"

This maps the SSH port to a known port that is available in the VM, recall I am using boot2docker which rides on VirtualBox, but the needs to be mapped out to where PyCharm can get at it. In VirtualBox, open the boot2docker VM and choose Adapter 1. Sometimes the "Attached to:" combo unselects itself, so watch for that. In my case it should have NAT selected.

Click "Port Forwarding" and map the inner port to the a port on localhost, I choose to use the same port number. It should be something like:

  • Name: ssh_mapped;
  • Protocol: TCP;
  • Host IP:127.0.0.1;
  • Host Port:7722;
  • Guest IP:;
  • Guest Port: 7722

Note: be careful not to change the boot2docker ssh setting or you will eventually be unable to start the VM correctly.

So, at this point we have a container that extends my target container. It runs ssh on port 22 and maps it to 7722 since other containers might want to use 22, and is visible in the VirtualBox environment. VirtualBox maps 7722 to 7722 to the localhost and you can ssh into the container with:

ssh root@localhost -p 7722

Which will then prompt for the password, 'soup4nuts' and you should be able to locate something specific to your container to verify that it is the right one and that everything works OK. I would not mess with root if I were deploying this anywhere but my local machine, so be warned. This is only for debugging locally and you should think twice or thrice about doing this on a live site.

At this point you can probably figure the rest of it out if you have used PyCharm's remote debugging. But here is how I set it up:

First, recall that I have docker-compose.yml mapping the project directory:

? /Users/me/source/myproject:/opt/applications/myproject 

In my container /opt/applications/myproject is actually /Users/me/source/myproject on my local hard drive. So, this is the root of my project. My PyCharm sees this directory as the project root and I want PyCharm to write the .pycharm_helpers here so that it persists between sessions. I am managing source code on the mac side of things, but PyCharm thinks it is a unixy box elsewhere. Yes, it is a bit of kludge until JetBrains incorporates a Docker solution.

First, go to the Project X/Project Structure and create a Content Root of the local mapping, in my case that means /Users/me/source/myproject

Later, come back and add .pycharm_helpers to the excluded set, we don't want this to end up in source control or confuse PyCharm.

Go to the Build, Execution, Deployment tab, pick Deployment and create a new Deployment of SFTP type. The host is localhost, the port 7722, the root path is /opt/applications/myproject and the username is root and password is soup4nuts and I checked the option to save the password. I named my Deployment 'dockercompose' so that I would be able to pick it out later.

On the Deployment Mappings tab I set the local path to /Users/me/source/myproject and deployment and web path to a single '/' but since my code doesn't correspond to a URL and I don't use this to debug, it is a placeholder in the Web Path setting. I don't know how you might set yours.

On the Project X/Project Interpreter tab, create a new Remote Python Interpreter. You can pick the Deployment Configuration and choose the dockercompose configuration we created above. The host URL should fill in as ssh://root@localhost:7722 and the Python Interpreter Path will likely be /usr/bin/python. We need to set the PyCharm Helpers Path as the default will not survive the container being redone. I actually went to my project local directory and created a .pycharm_helpers directory in the root, then set the path here as /opt/applications/myproject/.pycharm_helpers and when I hit the OK button it copied the files "up" to the directory. I don't know if it will create it automatically or not.

Don't forget that the .pycharm_helpers directory should probably be excluded on the project roots tab.

At this point you can go to the Build, Execution, Deployment tab, and under Console/Python Console, pick the remote interpreter we created above and set the working directory to /opt/applications/myproject and you can run your Python Console in the container if you like.

Now you need to create a Run Configuration so that you can remotely debug your python code. Make a new Python configuration and set the script to the one that used to start the python code in the container. Mine, from the supervisor setup, above is:

/opt/applications/myproject/worker.py -A args

So I set the script to /opt/applications/myproject/worker.py and the parameters to -A args.

Choose the remote interpreter we created above, and the working directory as needed, for me it is /opt/applications/myproject and for me that does the job.

Now I want to enter my container and stop the worker.py script so I can start up a debug version. Of course, if you like you can ignore running the script by default and only use the container for debugging.

I could open a ssh session to stop the script, but docker provides a useful command that will do the work for me by passing it into the environment.

$> docker exec -i -t supervisorctl stop worker

As my process is named 'worker'. Note that you can restart by replacing the stop command with start.

Now, in PyCharm start a debug session with the Run Configuration created above. It should connect and start things up and give you console output in the window. Since we killed the one that Supervision originally started it is no longer connected.

This was a seat of the pants operation, so there may be errors and incorrect assumptions I didn't notice. Particularly, the PyCharm setup required a few iterations, so the order may be incorrect, try going through it again if it fails. This is a lot of stuff and easy to skip something critical.

2 of 10
4

In order to avoid any SSH overhead (which makes perfect sense with Docker), docker exec definitely seems to be the way to go.
Unfortunately I couldn't get it to work so far. It would be great if someone could fill in the blanks. Here is what I did (using PyCharm 4.0.4 and Docker 1.4.1):

  1. Create a file named python_myproject.sh containing the following:

    #!/bin/bash
    docker exec -i myproject_container /path/to/containers/python2.7
    

    Note that the file's name has to begin with python otherwise PyCharm will complain.

  2. In PyCharm's settings, under Project Interpreter, add a new local interpreter. Give it the path to your python_myproject.sh file.


This is where I'm stuck. After a quite long loading time (the throbber says "Setting up library files"), a window entitled "Invalid Python SDK" appears and says:

Cannot set up a python SDK
at /path/to/python_myproject.sh.
The SDK seems invalid.

In ~/.PyCharm40/system/log/.idea:

2015-02-19 17:33:30,569 [ 166966]   WARN - ution.process.OSProcessHandler - Cannot kill process tree. Trying to destroy process using Java API. Cmdline:
2015-02-19 17:34:30,628 [ 227025]   WARN - ution.process.OSProcessHandler - Cannot kill process tree. Trying to destroy process using Java API. Cmdline:
2015-02-19 17:34:30,653 [ 227050]   INFO - rains.python.sdk.PythonSdkType - 
Timed out