diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..ccc6165 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" + } +} \ No newline at end of file diff --git a/poetry.toml b/poetry.toml new file mode 100644 index 0000000..ab1033b --- /dev/null +++ b/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true