🌐
Visual Studio Code
code.visualstudio.com › docs › devcontainers › create-dev-container
Create a Dev Container
November 3, 2021 - For this example, if you'd like to install the Code Spell Checker extension into your container and automatically forward port 3000, your devcontainer.json would look like: { "image": "mcr.microsoft.com/devcontainers/typescript-node", "customizations": { "vscode": { "extensions": ["streetsidesoftware.code-spell-checker"] } }, "forwardPorts": [3000] }
🌐
GitHub
github.com › microsoft › vscode-dev-containers › blob › main › containers › python-3 › README.md
vscode-dev-containers/containers/python-3/README.md at main · microsoft/vscode-dev-containers
This container installs all Python development utilities using pipx to avoid impacting the global Python environment. You can use this same utility add additional utilities in an isolated environment.
Author   microsoft
Discussions

Python Devcontainer Setup for VSCode
You don't really need a separate virtualenv if you're using a container. More on reddit.com
🌐 r/vscode
2
1
September 28, 2023
How fix Python import error in VS Code editor when using a Dev Container? - Stack Overflow
So I'm left wondering; how should one fix such IDE-flagged import errors in VS Code when using a Dev Container? As a file was requested in the comments, here are the key test project files I used (I've not fixed any paths; my last test project was named vscode-python-dev-container, not project, ... More on stackoverflow.com
🌐 stackoverflow.com
Are there many of you on here who do all their Python development inside a container?
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. More on reddit.com
🌐 r/Python
124
131
June 28, 2025
Debugging dockerized Python apps in VSCode
I find it easiest to just call breakpoint() in my code and use the docker attach command to drop into the command line debugger. No extra setup. And you can improve the command line experience with pdbpp or ipdb. More on reddit.com
🌐 r/Python
20
126
December 23, 2023
🌐
Visual Studio Code
code.visualstudio.com › docs › containers › quickstart-python
Python in a container
November 3, 2021 - Develop, build, and debug a Python app in a container, using Visual Studio Code.
🌐
GitHub
github.com › microsoft › vscode-remote-try-python
GitHub - microsoft/vscode-remote-try-python: Python sample project for trying out Dev Containers · GitHub
Press F1 and select the Dev Containers: Try a Sample... command. Choose the "Python" sample, wait for the container to start, and try things out!
Starred by 919 users
Forked by 1.8K users
Languages   Python 73.7% | HTML 26.3%
🌐
DEV Community
dev.to › jajera › python-development-in-vscode-using-devcontainer-2ao1
Python Development in VSCode Using Devcontainer - DEV Community
December 1, 2024 - Learn how to set up and use a devcontainer-based environment for Python development in VSCode using the devcontainer-python-template. Tagged with devcontainer, docker, python, vscode.
🌐
Visual Studio Code
code.visualstudio.com › docs › devcontainers › tutorial
Dev Containers tutorial
November 3, 2021 - More info: https://containers.dev/features. // "features": {}, "customizations": { "vscode": { "settings": {}, "extensions": ["streetsidesoftware.code-spell-checker"] } }, // "forwardPorts": [3000], "portsAttributes": { "3000": { "label": "Hello Remote World", "onAutoForward": "notify" } }, "postCreateCommand": "yarn install" // "remoteUser": "root" }
🌐
Visual Studio Code
code.visualstudio.com › docs › devcontainers › containers
Developing inside a Container
November 3, 2021 - The Visual Studio Code Dev Containers extension lets you use a container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set.
🌐
Xebia
xebia.com › home › blog › how to create a devcontainer for your python project
How To Create A Devcontainer For Your Python Project | Xebia
November 21, 2022 - The main requirement is that Node.js should be able to run: VSCode automatically installs VSCode Server on the machine. For an extensive list of supported distributions, see “Remote Development with Linux”. On top of python:3.10, we install Java and the required pip packages. The .devcontainer folder is in place, so it’s now time to open our Devcontainer. First, make sure you have the Dev Containers extension installed in VSCode (previously called “Remote - Containers”. That done, if you open your repo again, the extension should already detect your Devcontainer:
Find elsewhere
🌐
Medium
andypickup.com › developing-in-python-with-dev-containers-part-1-setup-f1aeb89cbfed
Developing in Python with Dev Containers — Part 1: Setup | by Andy Pickup | Medium
April 15, 2024 - And if you take a look at your Extensions, you’ll see everything we specified in the devcontainer.json file has been pre-installed: VSCode Extensions — pre-installed in the container · You’re ready to get started with some Python development.
🌐
Reddit
reddit.com › r/vscode › python devcontainer setup for vscode
r/vscode on Reddit: Python Devcontainer Setup for VSCode
September 28, 2023 -

I'm starting to look into devcontainers with VSCode and I am looking for a container configuration (Dockerfile/devcontainer.json) that sets up a good Python development environment with some recommended extensions and settings (e.g. paths, venv, fromatting, linting) for beginners (its been some time since I was doing Python development), but that's not over-complicated.

I have the following resources that I have pieced together as a starting point and could use some input and feedback on these (I'm not sure if everything makes sense) and what to improve for a good development experience. Particularly I'm looking for input on the VSCode extensions / settings.

docker-compose.dev.yaml

version: '3.9'

networks: app-dev-network: 
    driver: bridge 
    name: app-dev-network

services:

backend:

    image: backend-dev-image
    container_name: backend-dev-container
    build:
        context: ./
        dockerfile: ./Dockerfile.dev
    volumes:
        - ..:/workspace:cache
    networks:
        - app-dev-network
    ports:
        - target: 5000 
          published: 5000

    command: sleep infinity

Dockerfile.dev

ARG VARIANT="3.11-bookworm" 
FROM mcr.microsoft.com/devcontainers/python:${VARIANT}

RUN apt-get update && \    
apt-get upgrade --yes --no-install-recommends && \    
apt-get clean

ENV PYTHONUNBUFFERED=1

devcontainer.json

{
    "name": "Backend",
    "dockerComposeFile": [
        "./docker-compose.dev.yaml"
    ],
    "service": "backend",
    "workspaceFolder": "/workspace",

    "customizations": {  
        "vscode": {  
            "extensions": [  
                "ms-python.python",  
            ],  
            "settings": {  
                "python.pythonPath": "${workspaceFolder}/.venv/bin/python",             
                "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",  
            }  
        }  
    },

    "postCreateCommand": "pip3 install --user -r requirements.txt"
}

🌐
YouTube
youtube.com › microsoft developer
Set up a dev container for your Python app in Visual Studio Code - YouTube
In this demo, Luciana Abud uses the Remote Containers extension in Visual Studio Code to auto configure a dev container for a FlaskAPI + PostgreSQL app. Watc...
Published   May 25, 2021
Views   17K
🌐
GitHub
github.com › microsoft › vscode-dev-containers › blob › main › containers › python-3 › .devcontainer › devcontainer.json
vscode-dev-containers/containers/python-3/.devcontainer/devcontainer.json at main · microsoft/vscode-dev-containers
November 30, 2023 - // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 · // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local on arm64/Apple Silicon. "VARIANT": "3.10-bullseye", // Options · "NODE_VERSION": "lts/*" } }, · // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. "vscode": { // Set *default* container specific settings.json values on container create.
Author   microsoft
🌐
Everyday DevOps
markcallen.com › addpython-project-with-devcontainers-in-vs-code
Adding DevContainers to a Python Project - Everyday DevOps
August 6, 2025 - { "name": "Python Dev Container", ... "features": { "ghcr.io/devcontainers/features/git:1": {} } } This file tells VS Code how to build and run your container....
🌐
Medium
medium.com › @bernd.bornhausen › setting-up-visual-studio-code-with-docker-as-a-development-environment-for-python-da640978cae3
Setting up Visual Studio Code with Docker as a development environment for Python | by Bernd Bornhausen | Medium
January 25, 2022 - RUN python -m pip install -r requirements.txt #create a non root user to access the container RUN adduser -u 5678 —-disabled-password --gecos “” vscode · In order for VSC to use this Dockerfile to build your environment, you need to add a configuration file called ‘devcontainer.json’.
🌐
Docker Hub
hub.docker.com › r › microsoft › devcontainers-python
microsoft/devcontainers-python - Docker Image
Alternatively, you can use the contents of .devcontainer⁠ to fully customize the your container's contents or build for a container architecture the image does not support. Beyond Python and git, this image / Dockerfile includes a number of Python tools, zsh, Oh My Zsh!⁠, a non-root vscode user with sudo access, and a set of common dependencies for development.
🌐
Towards Data Science
towardsdatascience.com › home › latest › setting a dockerized python environment – the elegant way
Setting A Dockerized Python Environment - The Elegant Way | Towards Data Science
January 21, 2025 - Upon launch, the Dev Containers extension spins a new VScode session inside a container. By default, it mounts the local folder to the container, which enables us to keep the code persistent and sync with our local folder.
🌐
DEV Community
dev.to › mcastellin › hands-on-with-vscode-dev-containers-33bf
Hands-On with VSCode & "Dev Containers" - DEV Community
October 23, 2020 - I grabbed one of the projects I'll be collaborating with this Hacktoberfest. It's a Django application, so this will require our development environment to run with Python3. First, install the "Remote - Containers" extension from the VSCode marketplace
🌐
Medium
medium.com › @dexterwilliams04 › getting-started-with-python-3-dev-containers-4f14821fec6b
Getting Started with Python 3 Dev Containers | by Dexter Williams | Medium
October 1, 2020 - Permissions VS Code’s Python-3 dev container provides a non-root user that you can use to enforce that the interactive dev container sessions are not run as root. The non-root user is meant for the interactive sessions only.
🌐
Reddit
reddit.com › r/learnpython › python devcontainer setup for vscode
r/learnpython on Reddit: Python Devcontainer Setup for VSCode
September 28, 2023 - { "name": "Backend", "dockerComposeFile": [ "./docker-compose.dev.yaml" ], "service": "backend", "workspaceFolder": "/workspace", "customizations": { "vscode": { "extensions": [ "ms-python.python", ], "settings": { "python.pythonPath": "${workspaceFolder}/.venv/bin/python", "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python", } } }, "postCreateCommand": "pip3 install --user -r requirements.txt" }