A Python development container for Visual Studio Code.
The intention behind this project is to create a base development container that can be used in individual project repositories to setup an out-of-the-box development experience so that developers can get going quickly.
- Docker is installed and running
- Docker Compose is installed
- Visual Studio Code is installed
- Visual Studio Code Remote - Containers is installed
- Access and manage Docker on the Host machine from within the dev container
- Starship is installed as the default shell prompt
- GitHub CLI is installed
The easiest way to get started is to download the /templates/.devcontainer folder into your current project.
curl -L https://github.com/klein2ms/python-devcontainer/archive/master.tar.gz | tar -xz --strip=2 python-devcontainer-master/template/.devcontainerThe templates folder also contains a launch.json file which adds a nice F5 keyboard shortcut to run django. You can grab the whole .vscode folder using the following.
curl -L https://github.com/klein2ms/python-devcontainer/archive/master.tar.gz | tar -xz --strip=2 python-devcontainer-master/template/.vscodeIn VSCode, open the Command Palette F1 and select Remote-Containers: Reopen in Container.
The base devcontainer image accepts build arguments that can be set when building a derived image to extend the base image with additional packages and configurations.
This prevents the need of having to author additional code in the Dockerfile for a derived image. But, obviously that can be done as well.
Add DEBIAN_DEPS with a list of space separated packages to the list of build arguments.
# .devcontainer/docker-compose.yml
app:
build:
args:
DEBIAN_DEPS: "nano tree"
Add NPM_DEPS with a list of space separated packages to the list of build arguments.
# .devcontainer/docker-compose.yml
app:
build:
args:
NPM_DEPS: "yarn gulp"
Add PIP_DEPS with a list of space separated packages to the list of build arguments.
# .devcontainer/docker-compose.yml
app:
build:
args:
PIP_DEPS: "pylint pylint-django"
- This project is highly influenced by the godevcontainer created by @qdm12.
This repository is under an MIT license unless otherwise indicated.