Skip to content

Commit

Permalink
add a devcontainer config
Browse files Browse the repository at this point in the history
  • Loading branch information
tobru committed Aug 29, 2024
1 parent 5dedf90 commit e4ebce7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "984",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/python:1": {
"toolsToInstall": "flake8,autopep8,black,yapf,mypy,pydocstyle,pycodestyle,bandit,pipenv,virtualenv,pytest,pylint,poetry"
},
"ghcr.io/nikobockerman/devcontainer-features/poetry-persistent-cache:1": {}
},
"customizations": {
"vscode": {
"settings": {
"python.defaultInterpreterPath": ".venv/bin/python",
"python.terminal.activateEnvironment": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"python.envFile": "${workspaceFolder}/.env",
"editor.formatOnSave": true,
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"forwardPorts": [8000,5000],
"postCreateCommand": "poetry config virtualenvs.create false && poetry install",
"remoteUser": "vscode",
"workspaceMount": "", // fixed below in the --volume argument - enables rootless podman
"runArgs": [
"--userns=keep-id",
"--memory=0",
"--cpus=0",
"--volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z" // explicitly mount the workspace folder
],
"containerEnv": {
"HOME": "/home/vscode"
}
}
2 changes: 2 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
in-project = true

0 comments on commit e4ebce7

Please sign in to comment.